diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-02-18 17:48:17 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-02-18 17:48:17 +0000 |
commit | 02f2f366e28461263a7f1581a165b47d8f1174b9 (patch) | |
tree | f768fda9d8f528f44c185b9d1fb80581b32e3af6 | |
parent | e803f2a8f30b7eea1630f8208246c5cde6b3778e (diff) | |
download | rabbitmq-codegen-bug23525.tar.gz |
Pre-junkbug23525
-rw-r--r-- | LICENSE | 6 | ||||
-rw-r--r-- | LICENSE-MPL-RabbitMQ | 473 | ||||
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | README.extensions.md | 189 | ||||
-rw-r--r-- | amqp-rabbitmq-0.8.json | 660 | ||||
-rw-r--r-- | amqp-rabbitmq-0.9.1.json | 1412 | ||||
-rw-r--r-- | amqp_codegen.py | 305 | ||||
-rw-r--r-- | demo_extension.json | 18 |
8 files changed, 0 insertions, 3071 deletions
diff --git a/LICENSE b/LICENSE deleted file mode 100644 index c092f14..0000000 --- a/LICENSE +++ /dev/null @@ -1,6 +0,0 @@ -This package, the RabbitMQ code generation library and associated -files, is licensed under the MPL. For the MPL, please see -LICENSE-MPL-RabbitMQ. - -If you have any questions regarding licensing, please contact us at -info@rabbitmq.com. diff --git a/LICENSE-MPL-RabbitMQ b/LICENSE-MPL-RabbitMQ deleted file mode 100644 index 2d0a7b1..0000000 --- a/LICENSE-MPL-RabbitMQ +++ /dev/null @@ -1,473 +0,0 @@ - MOZILLA PUBLIC LICENSE - Version 1.1 - - --------------- - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the - Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to - the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original - Code, prior Modifications used by a Contributor, and the Modifications - made by that particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the - combination of the Original Code and Modifications, in each case - including portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally - accepted in the software development community for the electronic - transfer of data. - - 1.5. "Executable" means Covered Code in any form other than Source - Code. - - 1.6. "Initial Developer" means the individual or entity identified - as the Initial Developer in the Source Code notice required by Exhibit - A. - - 1.7. "Larger Work" means a work which combines Covered Code or - portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum - extent possible, whether at the time of the initial grant or - subsequently acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the - substance or structure of either the Original Code or any previous - Modifications. When Covered Code is released as a series of files, a - Modification is: - A. Any addition to or deletion from the contents of a file - containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or - previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code - which is described in the Source Code notice required by Exhibit A as - Original Code, and which, at the time of its release under this - License is not already Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or - hereafter acquired, including without limitation, method, process, - and apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for - making modifications to it, including all modules it contains, plus - any associated interface definition files, scripts used to control - compilation and installation of an Executable, or source code - differential comparisons against either the Original Code or another - well known, available Covered Code of the Contributor's choice. The - Source Code can be in a compressed or archival form, provided the - appropriate decompression or de-archiving software is widely available - for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity - exercising rights under, and complying with all of the terms of, this - License or a future version of this License issued under Section 6.1. - For legal entities, "You" includes any entity which controls, is - controlled by, or is under common control with You. For purposes of - this definition, "control" means (a) the power, direct or indirect, - to cause the direction or management of such entity, whether by - contract or otherwise, or (b) ownership of more than fifty percent - (50%) of the outstanding shares or beneficial ownership of such - entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, - non-exclusive license, subject to third party intellectual property - claims: - (a) under intellectual property rights (other than patent or - trademark) Licensable by Initial Developer to use, reproduce, - modify, display, perform, sublicense and distribute the Original - Code (or portions thereof) with or without Modifications, and/or - as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or - selling of Original Code, to make, have made, use, practice, - sell, and offer for sale, and/or otherwise dispose of the - Original Code (or portions thereof). - - (c) the licenses granted in this Section 2.1(a) and (b) are - effective on the date Initial Developer first distributes - Original Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is - granted: 1) for code that You delete from the Original Code; 2) - separate from the Original Code; or 3) for infringements caused - by: i) the modification of the Original Code or ii) the - combination of the Original Code with other software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor - hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or - trademark) Licensable by Contributor, to use, reproduce, modify, - display, perform, sublicense and distribute the Modifications - created by such Contributor (or portions thereof) either on an - unmodified basis, with other Modifications, as Covered Code - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or - selling of Modifications made by that Contributor either alone - and/or in combination with its Contributor Version (or portions - of such combination), to make, use, sell, offer for sale, have - made, and/or otherwise dispose of: 1) Modifications made by that - Contributor (or portions thereof); and 2) the combination of - Modifications made by that Contributor with its Contributor - Version (or portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are - effective on the date Contributor first makes Commercial Use of - the Covered Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is - granted: 1) for any code that Contributor has deleted from the - Contributor Version; 2) separate from the Contributor Version; - 3) for infringements caused by: i) third party modifications of - Contributor Version or ii) the combination of Modifications made - by that Contributor with other software (except as part of the - Contributor Version) or other devices; or 4) under Patent Claims - infringed by Covered Code in the absence of Modifications made by - that Contributor. - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are - governed by the terms of this License, including without limitation - Section 2.2. The Source Code version of Covered Code may be - distributed only under the terms of this License or a future version - of this License released under Section 6.1, and You must include a - copy of this License with every copy of the Source Code You - distribute. You may not offer or impose any terms on any Source Code - version that alters or restricts the applicable version of this - License or the recipients' rights hereunder. However, You may include - an additional document offering the additional rights described in - Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be - made available in Source Code form under the terms of this License - either on the same media as an Executable version or via an accepted - Electronic Distribution Mechanism to anyone to whom you made an - Executable version available; and if made available via Electronic - Distribution Mechanism, must remain available for at least twelve (12) - months after the date it initially became available, or at least six - (6) months after a subsequent version of that particular Modification - has been made available to such recipients. You are responsible for - ensuring that the Source Code version remains available even if the - Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a - file documenting the changes You made to create that Covered Code and - the date of any change. You must include a prominent statement that - the Modification is derived, directly or indirectly, from Original - Code provided by the Initial Developer and including the name of the - Initial Developer in (a) the Source Code, and (b) in any notice in an - Executable version or related documentation in which You describe the - origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's - intellectual property rights is required to exercise the rights - granted by such Contributor under Sections 2.1 or 2.2, - Contributor must include a text file with the Source Code - distribution titled "LEGAL" which describes the claim and the - party making the claim in sufficient detail that a recipient will - know whom to contact. If Contributor obtains such knowledge after - the Modification is made available as described in Section 3.2, - Contributor shall promptly modify the LEGAL file in all copies - Contributor makes available thereafter and shall take other steps - (such as notifying appropriate mailing lists or newsgroups) - reasonably calculated to inform those who received the Covered - Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming - interface and Contributor has knowledge of patent licenses which - are reasonably necessary to implement that API, Contributor must - also include this information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to - Section 3.4(a) above, Contributor believes that Contributor's - Modifications are Contributor's original creation(s) and/or - Contributor has sufficient rights to grant the rights conveyed by - this License. - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source - Code. If it is not possible to put such notice in a particular Source - Code file due to its structure, then You must include such notice in a - location (such as a relevant directory) where a user would be likely - to look for such a notice. If You created one or more Modification(s) - You may add your name as a Contributor to the notice described in - Exhibit A. You must also duplicate this License in any documentation - for the Source Code where You describe recipients' rights or ownership - rights relating to Covered Code. You may choose to offer, and to - charge a fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Code. However, You - may do so only on Your own behalf, and not on behalf of the Initial - Developer or any Contributor. You must make it absolutely clear than - any such warranty, support, indemnity or liability obligation is - offered by You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred by the - Initial Developer or such Contributor as a result of warranty, - support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the - requirements of Section 3.1-3.5 have been met for that Covered Code, - and if You include a notice stating that the Source Code version of - the Covered Code is available under the terms of this License, - including a description of how and where You have fulfilled the - obligations of Section 3.2. The notice must be conspicuously included - in any notice in an Executable version, related documentation or - collateral in which You describe recipients' rights relating to the - Covered Code. You may distribute the Executable version of Covered - Code or ownership rights under a license of Your choice, which may - contain terms different from this License, provided that You are in - compliance with the terms of this License and that the license for the - Executable version does not attempt to limit or alter the recipient's - rights in the Source Code version from the rights set forth in this - License. If You distribute the Executable version under a different - license You must make it absolutely clear that any terms which differ - from this License are offered by You alone, not by the Initial - Developer or any Contributor. You hereby agree to indemnify the - Initial Developer and every Contributor for any liability incurred by - the Initial Developer or such Contributor as a result of any such - terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code - not governed by the terms of this License and distribute the Larger - Work as a single product. In such a case, You must make sure the - requirements of this License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this - License with respect to some or all of the Covered Code due to - statute, judicial order, or regulation then You must: (a) comply with - the terms of this License to the maximum extent possible; and (b) - describe the limitations and the code they affect. Such description - must be included in the LEGAL file described in Section 3.4 and must - be included with all distributions of the Source Code. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has - attached the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised - and/or new versions of the License from time to time. Each version - will be given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the - License, You may always continue to use it under the terms of that - version. You may also choose to use such Covered Code under the terms - of any subsequent version of the License published by Netscape. No one - other than Netscape has the right to modify the terms applicable to - Covered Code created under this License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may - only do in order to apply it to code which is not already Covered Code - governed by this License), You must (a) rename Your license so that - the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", - "MPL", "NPL" or any confusingly similar phrase do not appear in your - license (except to note that your license differs from this License) - and (b) otherwise make it clear that Your version of the license - contains terms which differ from the Mozilla Public License and - Netscape Public License. (Filling in the name of the Initial - Developer, Original Code or Contributor in the notice described in - Exhibit A shall not of themselves be deemed to be modifications of - this License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF - DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. - THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE - IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, - YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE - COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER - OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate - automatically if You fail to comply with terms herein and fail to cure - such breach within 30 days of becoming aware of the breach. All - sublicenses to the Covered Code which are properly granted shall - survive any termination of this License. Provisions which, by their - nature, must remain in effect beyond the termination of this License - shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement - claim (excluding declatory judgment actions) against Initial Developer - or a Contributor (the Initial Developer or Contributor against whom - You file such action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly - infringes any patent, then any and all rights granted by such - Participant to You under Sections 2.1 and/or 2.2 of this License - shall, upon 60 days notice from Participant terminate prospectively, - unless if within 60 days after receipt of notice You either: (i) - agree in writing to pay Participant a mutually agreeable reasonable - royalty for Your past and future use of Modifications made by such - Participant, or (ii) withdraw Your litigation claim with respect to - the Contributor Version against such Participant. If within 60 days - of notice, a reasonable royalty and payment arrangement are not - mutually agreed upon in writing by the parties or the litigation claim - is not withdrawn, the rights granted by Participant to You under - Sections 2.1 and/or 2.2 automatically terminate at the expiration of - the 60 day notice period specified above. - - (b) any software, hardware, or device, other than such Participant's - Contributor Version, directly or indirectly infringes any patent, then - any rights granted to You by such Participant under Sections 2.1(b) - and 2.2(b) are revoked effective as of the date You first made, used, - sold, distributed, or had made, Modifications made by that - Participant. - - 8.3. If You assert a patent infringement claim against Participant - alleging that such Participant's Contributor Version directly or - indirectly infringes any patent where such claim is resolved (such as - by license or settlement) prior to the initiation of patent - infringement litigation, then the reasonable value of the licenses - granted by such Participant under Sections 2.1 or 2.2 shall be taken - into account in determining the amount or value of any payment or - license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, - all end user license agreements (excluding distributors and resellers) - which have been validly granted by You or any distributor hereunder - prior to termination shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL - DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, - OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR - ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY - CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, - WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY - RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW - PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE - EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO - THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in - 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer - software" and "commercial computer software documentation," as such - terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 - C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), - all U.S. Government End Users acquire Covered Code with only those - rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. This License shall be governed by - California law provisions (except to the extent applicable law, if - any, provides otherwise), excluding its conflict-of-law provisions. - With respect to disputes in which at least one party is a citizen of, - or an entity chartered or registered to do business in the United - States of America, any litigation relating to this License shall be - subject to the jurisdiction of the Federal Courts of the Northern - District of California, with venue lying in Santa Clara County, - California, with the losing party responsible for costs, including - without limitation, court costs and reasonable attorneys' fees and - expenses. The application of the United Nations Convention on - Contracts for the International Sale of Goods is expressly excluded. - Any law or regulation which provides that the language of a contract - shall be construed against the drafter shall not apply to this - License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or indirectly, - out of its utilization of rights under this License and You agree to - work with Initial Developer and Contributors to distribute such - responsibility on an equitable basis. Nothing herein is intended or - shall be deemed to constitute any admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as - "Multiple-Licensed". "Multiple-Licensed" means that the Initial - Developer permits you to utilize portions of the Covered Code under - Your choice of the NPL or the alternative licenses, if any, specified - by the Initial Developer in the file described in Exhibit A. - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License - Version 1.1 (the "License"); you may not use this file except in - compliance with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - License for the specific language governing rights and limitations - under the License. - - The Original Code is RabbitMQ. - - The Initial Developers of the Original Code are LShift Ltd, - Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. - - Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, - Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd - are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial - Technologies LLC, and Rabbit Technologies Ltd. - - Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift - Ltd. Portions created by Cohesive Financial Technologies LLC are - Copyright (C) 2007-2009 Cohesive Financial Technologies - LLC. Portions created by Rabbit Technologies Ltd are Copyright - (C) 2007-2009 Rabbit Technologies Ltd. - - All Rights Reserved. - - Contributor(s): ______________________________________.'' - - [NOTE: The text of this Exhibit A may differ slightly from the text of - the notices in the Source Code files of the Original Code. You should - use the text of this Exhibit A rather than the text found in the - Original Code Source Code for Your Modifications.] - - - diff --git a/Makefile b/Makefile deleted file mode 100644 index 8c3bfa9..0000000 --- a/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: - echo "Please select a target from the Makefile." - -clean: - rm -f *.pyc - -distclean: clean - find . -regex '.*\(~\|#\|\.swp\)' -exec rm {} \; diff --git a/README.extensions.md b/README.extensions.md deleted file mode 100644 index 74b24fc..0000000 --- a/README.extensions.md +++ /dev/null @@ -1,189 +0,0 @@ -# Protocol extensions - -The `amqp_codegen.py` AMQP specification compiler has recently been -enhanced to take more than a single specification file, which allows -AMQP library authors to include extensions to the core protocol -without needing to modify the core AMQP specification file as -distributed. - -The compiler is invoked with the path to a single "main" specification -document and zero or more paths to "extension" documents. - -The order of the extensions matters: any later class property -definitions, for instance, are added to the list of definitions in -order of appearance. In general, composition of extensions with a core -specification document is therefore non-commutative. - -## The main document - -Written in the style of a -[json-shapes](http://github.com/tonyg/json-shapes) schema: - - DomainDefinition = _and(array_of(string()), array_length_equals(2)); - - ConstantDefinition = { - "name": string(), - "value": number(), - "class": optional(_or("soft-error", "hard-error")) - }; - - FieldDefinition = { - "name": string(), - "type": string(), - "default-value": optional(anything()) - }; - - MethodDefinition = { - "name": string(), - "id": number(), - "arguments": array_of(FieldDefinition), - "synchronous": optional(boolean()), - "content": optional(boolean()) - }; - - ClassDefinition = { - "name": string(), - "id": number(), - "methods": array_of(MethodDefinition), - "properties": optional(array_of(FieldDefinition)) - }; - - MainDocument = { - "major-version": number(), - "minor-version": number(), - "revision": optional(number()), - "port": number(), - "domains": array_of(DomainDefinition), - "constants": array_of(ConstantDefinition), - "classes": array_of(ClassDefinition), - } - -Within a `FieldDefinition`, the keyword `domain` can be used instead -of `type`, but `type` is preferred and `domain` is deprecated. - -Type names can either be a defined `domain` name or a built-in name -from the following list: - - - octet - - shortstr - - longstr - - short - - long - - longlong - - bit - - table - - timestamp - -Method and class IDs must be integers between 0 and 65535, -inclusive. Note that there is no specific subset of the space reserved -for experimental or site-local extensions, so be careful not to -conflict with IDs used by the AMQP core specification. - -If the `synchronous` field of a `MethodDefinition` is missing, it is -assumed to be `false`; the same applies to the `content` field. - -A `ConstantDefinition` with a `class` attribute is considered to be an -error-code definition; otherwise, it is considered to be a -straightforward numeric constant. - -## Extensions - -Written in the style of a -[json-shapes](http://github.com/tonyg/json-shapes) schema, and -referencing some of the type definitions given above: - - ExtensionDocument = { - "extension": anything(), - "domains": array_of(DomainDefinition), - "constants": array_of(ConstantDefinition), - "classes": array_of(ClassDefinition) - }; - -The `extension` keyword is used to describe the extension informally -for human readers. Typically it will be a dictionary, with members -such as: - - { - "name": "The name of the extension", - "version": "1.0", - "copyright": "Copyright (C) 1234 Yoyodyne, Inc." - } - -## Merge behaviour - -In the case of conflicts between values specified in the main document -and in any extension documents, type-specific merge operators are -invoked. - - - Any doubly-defined domain names are regarded as true - conflicts. Otherwise, all the domain definitions from all the main - and extension documents supplied to the compiler are merged into a - single dictionary. - - - Constant definitions are treated as per domain names above, - *mutatis mutandis*. - - - Classes and their methods are a little trickier: if an extension - defines a class with the same name as one previously defined, then - only the `methods` and `properties` fields of the extension's class - definition are attended to. - - - Any doubly-defined method names or property names within a class - are treated as true conflicts. - - - Properties defined in an extension are added to the end of the - extant property list for the class. - - (Extensions are of course permitted to define brand new classes as - well as to extend existing ones.) - - - Any other kind of conflict leads to a raised - `AmqpSpecFileMergeConflict` exception. - -## Invoking the spec compiler - -Your code generation code should invoke `amqp_codegen.do_main_dict` -with a dictionary of functions as the sole argument. Each will be -used for generationg a separate file. The `do_main_dict` function -will parse the command-line arguments supplied when python was -invoked. - -The command-line will be parsed as: - - python your_codegen.py <action> <mainspec> [<extspec> ...] <outfile> - -where `<action>` is a key into the dictionary supplied to -`do_main_dict` and is used to select which generation function is -called. The `<mainspec>` and `<extspec>` arguments are file names of -specification documents containing expressions in the syntax given -above. The *final* argument on the command line, `<outfile>`, is the -name of the source-code file to generate. - -Here's a tiny example of the layout of a code generation module that -uses `amqp_codegen`: - - import amqp_codegen - - def generateHeader(specPath): - spec = amqp_codegen.AmqpSpec(specPath) - ... - - def generateImpl(specPath): - spec = amqp_codegen.AmqpSpec(specPath) - ... - - if __name__ == "__main__": - amqp_codegen.do_main_dict({"header": generateHeader, - "body": generateImpl}) - -The reasons for allowing more than one action, are that - - - many languages have separate "header"-type files (C and Erlang, to - name two) - - `Makefile`s often require separate rules for generating the two - kinds of file, but it's convenient to keep the generation code - together in a single python module - -The main reason things are laid out this way, however, is simply that -it's an accident of the history of the code. We may change the API to -`amqp_codegen` in future to clean things up a little. diff --git a/amqp-rabbitmq-0.8.json b/amqp-rabbitmq-0.8.json deleted file mode 100644 index 081b804..0000000 --- a/amqp-rabbitmq-0.8.json +++ /dev/null @@ -1,660 +0,0 @@ -{ - "name": "AMQP", - "major-version": 8, - "minor-version": 0, - "port": 5672, - "copyright": [ - "Copyright (C) 2008-2009 LShift Ltd, Cohesive Financial Technologies LLC,\n", - "and Rabbit Technologies Ltd\n", - "\n", - "Permission is hereby granted, free of charge, to any person\n", - "obtaining a copy of this file (the \"Software\"), to deal in the\n", - "Software without restriction, including without limitation the \n", - "rights to use, copy, modify, merge, publish, distribute, \n", - "sublicense, and/or sell copies of the Software, and to permit \n", - "persons to whom the Software is furnished to do so, subject to \n", - "the following conditions:\n", - "\n", - "The above copyright notice and this permission notice shall be\n", - "included in all copies or substantial portions of the Software.\n", - "\n", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n", - "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n", - "OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n", - "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n", - "HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n", - "WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n", - "FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n", - "OTHER DEALINGS IN THE SOFTWARE.\n", - "\n", - "Class information entered from amqp_xml0-8.pdf and domain types from amqp-xml-doc0-9.pdf\n", - "\n", - "b3cb053f15e7b98808c0ccc67f23cb3e amqp_xml0-8.pdf\n", - "http://www.twiststandards.org/index.php?option=com_docman&task=cat_view&gid=28&&Itemid=90\n", - "8444db91e2949dbecfb2585e9eef6d64 amqp-xml-doc0-9.pdf\n", - "https://jira.amqp.org/confluence/download/attachments/720900/amqp-xml-doc0-9.pdf?version=1\n"], - - "domains": [ - ["access-ticket", "short"], - ["bit", "bit"], - ["channel-id", "longstr"], - ["class-id", "short"], - ["consumer-tag", "shortstr"], - ["delivery-tag", "longlong"], - ["destination", "shortstr"], - ["duration", "longlong"], - ["exchange-name", "shortstr"], - ["known-hosts", "shortstr"], - ["long", "long"], - ["longlong", "longlong"], - ["longstr", "longstr"], - ["method-id", "short"], - ["no-ack", "bit"], - ["no-local", "bit"], - ["octet", "octet"], - ["offset", "longlong"], - ["path", "shortstr"], - ["peer-properties", "table"], - ["queue-name", "shortstr"], - ["redelivered", "bit"], - ["reference", "longstr"], - ["reject-code", "short"], - ["reject-text", "shortstr"], - ["reply-code", "short"], - ["reply-text", "shortstr"], - ["security-token", "longstr"], - ["short", "short"], - ["shortstr", "shortstr"], - ["table", "table"], - ["timestamp", "timestamp"] - ], - - "constants": [ - {"name": "FRAME-METHOD", "value": 1}, - {"name": "FRAME-HEADER", "value": 2}, - {"name": "FRAME-BODY", "value": 3}, - {"name": "FRAME-OOB-METHOD", "value": 4}, - {"name": "FRAME-OOB-HEADER", "value": 5}, - {"name": "FRAME-OOB-BODY", "value": 6}, - {"name": "FRAME-TRACE", "value": 7}, - {"name": "FRAME-HEARTBEAT", "value": 8}, - {"name": "FRAME-MIN-SIZE", "value": 4096}, - {"name": "FRAME-END", "value": 206}, - {"name": "REPLY-SUCCESS", "value": 200}, - {"name": "NOT-DELIVERED", "value": 310, "class": "soft-error"}, - {"name": "CONTENT-TOO-LARGE", "value": 311, "class": "soft-error"}, - {"name": "NO-ROUTE", "value": 312, "class": "soft-error"}, - {"name": "NO-CONSUMERS", "value": 313, "class": "soft-error"}, - {"name": "ACCESS-REFUSED", "value": 403, "class": "soft-error"}, - {"name": "NOT-FOUND", "value": 404, "class": "soft-error"}, - {"name": "RESOURCE-LOCKED", "value": 405, "class": "soft-error"}, - {"name": "PRECONDITION-FAILED", "value": 406, "class": "soft-error"}, - {"name": "CONNECTION-FORCED", "value": 320, "class": "hard-error"}, - {"name": "INVALID-PATH", "value": 402, "class": "hard-error"}, - {"name": "FRAME-ERROR", "value": 501, "class": "hard-error"}, - {"name": "SYNTAX-ERROR", "value": 502, "class": "hard-error"}, - {"name": "COMMAND-INVALID", "value": 503, "class": "hard-error"}, - {"name": "CHANNEL-ERROR", "value": 504, "class": "hard-error"}, - {"name": "UNEXPECTED-FRAME", "value": 505, "class": "hard-error"}, - {"name": "RESOURCE-ERROR", "value": 506, "class": "hard-error"}, - {"name": "NOT-ALLOWED", "value": 530, "class": "hard-error"}, - {"name": "NOT-IMPLEMENTED", "value": 540, "class": "hard-error"}, - {"name": "INTERNAL-ERROR", "value": 541, "class": "hard-error"} - ], - - "classes": [ - { - "id": 10, - "methods": [{"id": 10, - "arguments": [{"type": "octet", "name": "version-major", "default-value": 0}, - {"type": "octet", "name": "version-minor", "default-value": 8}, - {"domain": "peer-properties", "name": "server properties"}, - {"type": "longstr", "name": "mechanisms", "default-value": "PLAIN"}, - {"type": "longstr", "name": "locales", "default-value": "en_US"}], - "name": "start", - "synchronous" : true}, - {"id": 11, - "arguments": [{"domain": "peer-properties", "name": "client-properties"}, - {"type": "shortstr", "name": "mechanism", "default-value": "PLAIN"}, - {"type": "longstr", "name": "response"}, - {"type": "shortstr", "name": "locale", "default-value": "en_US"}], - "name": "start-ok"}, - {"id": 20, - "arguments": [{"type": "longstr", "name": "challenge"}], - "name": "secure", - "synchronous" : true}, - {"id": 21, - "arguments": [{"type": "longstr", "name": "response"}], - "name": "secure-ok"}, - {"id": 30, - "arguments": [{"type": "short", "name": "channel-max", "default-value": 0}, - {"type": "long", "name": "frame-max", "default-value": 0}, - {"type": "short", "name": "heartbeat", "default-value": 0}], - "name": "tune", - "synchronous" : true}, - {"id": 31, - "arguments": [{"type": "short", "name": "channel-max", "default-value": 0}, - {"type": "long", "name": "frame-max", "default-value": 0}, - {"type": "short", "name": "heartbeat", "default-value": 0}], - "name": "tune-ok"}, - {"id": 40, - "arguments": [{"type": "shortstr", "name": "virtual-host", "default-value": "/"}, - {"type": "shortstr", "name": "capabilities", "default-value": ""}, - {"type": "bit", "name": "insist", "default-value": false}], - "name": "open", - "synchronous" : true}, - {"id": 41, - "arguments": [{"type": "shortstr", "name": "known-hosts", "default-value": ""}], - "name": "open-ok"}, - {"id": 50, - "arguments": [{"type": "shortstr", "name": "host"}, - {"type": "shortstr", "name": "known-hosts", "default-value": ""}], - "name": "redirect"}, - {"id": 60, - "arguments": [{"type": "short", "name": "reply-code"}, - {"type": "shortstr", "name": "reply-text", "default-value": ""}, - {"type": "short", "name": "class-id"}, - {"type": "short", "name": "method-id"}], - "name": "close", - "synchronous" : true}, - {"id": 61, - "arguments": [], - "name": "close-ok"}], - "name": "connection", - "properties": [] - }, - { - "id": 20, - "methods": [{"id": 10, - "arguments": [{"type": "shortstr", "name": "out-of-band", "default-value": ""}], - "name": "open", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "open-ok"}, - {"id": 20, - "arguments": [{"type": "bit", "name": "active"}], - "name": "flow", - "synchronous" : true}, - {"id": 21, - "arguments": [{"type": "bit", "name": "active"}], - "name": "flow-ok"}, - {"id": 30, - "arguments": [{"type": "short", "name": "reply-code"}, - {"type": "shortstr", "name": "reply-text", "default-value": ""}, - {"type": "table", "name": "details", "default-value": {}}], - "name": "alert"}, - {"id": 40, - "arguments": [{"type": "short", "name": "reply-code"}, - {"type": "shortstr", "name": "reply-text", "default-value": ""}, - {"type": "short", "name": "class-id"}, - {"type": "short", "name": "method-id"}], - "name": "close", - "synchronous" : true}, - {"id": 41, - "arguments": [], - "name": "close-ok"}], - "name": "channel" - }, - { - "id": 30, - "methods": [{"id": 10, - "arguments": [{"type": "shortstr", "name": "realm", "default-value": "/data"}, - {"type": "bit", "name": "exclusive", "default-value": false}, - {"type": "bit", "name": "passive", "default-value": true}, - {"type": "bit", "name": "active", "default-value": true}, - {"type": "bit", "name": "write", "default-value": true}, - {"type": "bit", "name": "read", "default-value": true}], - "name": "request", - "synchronous" : true}, - {"id": 11, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}], - "name": "request-ok"}], - "name": "access" - }, - { - "id": 40, - "methods": [{"id": 10, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "type", "default-value": "direct"}, - {"type": "bit", "name": "passive", "default-value": false}, - {"type": "bit", "name": "durable", "default-value": false}, - {"type": "bit", "name": "auto-delete", "default-value": false}, - {"type": "bit", "name": "internal", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}, - {"type": "table", "name": "arguments", "default-value": {}}], - "name": "declare", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "declare-ok"}, - {"id": 20, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "exchange"}, - {"type": "bit", "name": "if-unused", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "delete", - "synchronous" : true}, - {"id": 21, - "arguments": [], - "name": "delete-ok"}], - "name": "exchange" - }, - { - "id": 50, - "methods": [{"id": 10, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue", "default-value": ""}, - {"type": "bit", "name": "passive", "default-value": false}, - {"type": "bit", "name": "durable", "default-value": false}, - {"type": "bit", "name": "exclusive", "default-value": false}, - {"type": "bit", "name": "auto-delete", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}, - {"type": "table", "name": "arguments", "default-value": {}}], - "name": "declare", - "synchronous" : true}, - {"id": 11, - "arguments": [{"type": "shortstr", "name": "queue"}, - {"type": "long", "name": "message-count"}, - {"type": "long", "name": "consumer-count"}], - "name": "declare-ok"}, - {"id": 20, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue"}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key", "default-value": ""}, - {"type": "bit", "name": "nowait", "default-value": false}, - {"type": "table", "name": "arguments", "default-value": {}}], - "name": "bind", - "synchronous" : true}, - {"id": 21, - "arguments": [], - "name": "bind-ok"}, - {"id": 30, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue"}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "purge", - "synchronous" : true}, - {"id": 31, - "arguments": [{"type": "long", "name": "message-count"}], - "name": "purge-ok"}, - {"id": 40, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue"}, - {"type": "bit", "name": "if-unused", "default-value": false}, - {"type": "bit", "name": "if-empty", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "delete", - "synchronous" : true}, - {"id": 41, - "arguments": [{"type": "long", "name": "message-count"}], - "name": "delete-ok"}, - {"id": 50, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue"}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key", "default-value": ""}, - {"type": "table", "name": "arguments", "default-value": {}}], - "name": "unbind", - "synchronous" : true}, - {"id": 51, - "arguments": [], - "name": "unbind-ok"} - ], - "name": "queue" - }, - { - "id": 60, - "methods": [{"id": 10, - "arguments": [{"type": "long", "name": "prefetch-size", "default-value": 0}, - {"type": "short", "name": "prefetch-count", "default-value": 0}, - {"type": "bit", "name": "global", "default-value": false}], - "name": "qos", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "qos-ok"}, - {"id": 20, - "arguments": [{"domain": "access-ticket", "name": "ticket", "default-value": 1}, - {"domain": "queue-name", "name": "queue"}, - {"type": "shortstr", "name": "consumer-tag", "default-value": ""}, - {"type": "bit", "name": "no-local", "default-value": false}, - {"type": "bit", "name": "no-ack", "default-value": false}, - {"type": "bit", "name": "exclusive", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "consume", - "synchronous" : true}, - {"id": 21, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}], - "name": "consume-ok"}, - {"id": 30, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "cancel", - "synchronous" : true}, - {"id": 31, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}], - "name": "cancel-ok"}, - {"content": true, - "id": 40, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "exchange", "default-value": ""}, - {"type": "shortstr", "name": "routing-key", "default-value": ""}, - {"type": "bit", "name": "mandatory", "default-value": false}, - {"type": "bit", "name": "immediate", "default-value": false}], - "name": "publish"}, - {"content": true, - "id": 50, - "arguments": [{"type": "short", "name": "reply-code"}, - {"type": "shortstr", "name": "reply-text", "default-value": ""}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key"}], - "name": "return"}, - {"content": true, - "id": 60, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}, - {"type": "longlong", "name": "delivery-tag"}, - {"type": "bit", "name": "redelivered", "default-value": false}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key"}], - "name": "deliver"}, - {"id": 70, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue"}, - {"type": "bit", "name": "no-ack", "default-value": false}], - "name": "get", - "synchronous" : true}, - {"content": true, - "id": 71, - "arguments": [{"type": "longlong", "name": "delivery-tag"}, - {"type": "bit", "name": "redelivered", "default-value": false}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key"}, - {"type": "long", "name": "message-count"}], - "name": "get-ok"}, - {"id": 72, - "arguments": [{"type": "shortstr", "name": "cluster-id", "default-value": ""}], - "name": "get-empty"}, - {"id": 80, - "arguments": [{"type": "longlong", "name": "delivery-tag", "default-value": 0}, - {"type": "bit", "name": "multiple", "default-value": false}], - "name": "ack"}, - {"id": 90, - "arguments": [{"type": "longlong", "name": "delivery-tag"}, - {"type": "bit", "name": "requeue", "default-value": true}], - "name": "reject"}, - {"id": 100, - "arguments": [{"type": "bit", "name": "requeue", "default-value": false}], - "name": "recover-async"}, - {"id": 110, - "arguments": [{"type": "bit", "name": "requeue", "default-value": false}], - "name": "recover", - "synchronous" : true}, - {"id": 111, - "arguments": [], - "name": "recover-ok"}], - "name": "basic", - "properties": [{"type": "shortstr", "name": "content-type"}, - {"type": "shortstr", "name": "content-encoding"}, - {"type": "table", "name": "headers"}, - {"type": "octet", "name": "delivery-mode"}, - {"type": "octet", "name": "priority"}, - {"type": "shortstr", "name": "correlation-id"}, - {"type": "shortstr", "name": "reply-to"}, - {"type": "shortstr", "name": "expiration"}, - {"type": "shortstr", "name": "message-id"}, - {"type": "timestamp", "name": "timestamp"}, - {"type": "shortstr", "name": "type"}, - {"type": "shortstr", "name": "user-id"}, - {"type": "shortstr", "name": "app-id"}, - {"type": "shortstr", "name": "cluster-id"}] - }, - { - "id": 70, - "methods": [{"id": 10, - "arguments": [{"type": "long", "name": "prefetch-size", "default-value": 0}, - {"type": "short", "name": "prefetch-count", "default-value": 0}, - {"type": "bit", "name": "global", "default-value": false}], - "name": "qos", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "qos-ok"}, - {"id": 20, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue"}, - {"type": "shortstr", "name": "consumer-tag", "default-value": ""}, - {"type": "bit", "name": "no-local", "default-value": false}, - {"type": "bit", "name": "no-ack", "default-value": false}, - {"type": "bit", "name": "exclusive", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "consume", - "synchronous" : true}, - {"id": 21, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}], - "name": "consume-ok"}, - {"id": 30, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "cancel", - "synchronous" : true}, - {"id": 31, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}], - "name": "cancel-ok"}, - {"id": 40, - "arguments": [{"type": "shortstr", "name": "identifier"}, - {"type": "longlong", "name": "content-size"}], - "name": "open", - "synchronous" : true}, - {"id": 41, - "arguments": [{"type": "longlong", "name": "staged-size"}], - "name": "open-ok"}, - {"content": true, - "id": 50, - "arguments": [], - "name": "stage"}, - {"id": 60, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "exchange", "default-value": ""}, - {"type": "shortstr", "name": "routing-key", "default-value": ""}, - {"type": "bit", "name": "mandatory", "default-value": false}, - {"type": "bit", "name": "immediate", "default-value": false}, - {"type": "shortstr", "name": "identifier"}], - "name": "publish"}, - {"content": true, - "id": 70, - "arguments": [{"type": "short", "name": "reply-code", "default-value": 200}, - {"type": "shortstr", "name": "reply-text", "default-value": ""}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key"}], - "name": "return"}, - {"id": 80, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}, - {"type": "longlong", "name": "delivery-tag"}, - {"type": "bit", "name": "redelivered", "default-value": false}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key"}, - {"type": "shortstr", "name": "identifier"}], - "name": "deliver"}, - {"id": 90, - "arguments": [{"type": "longlong", "name": "delivery-tag", "default-value": 0}, - {"type": "bit", "name": "multiple", "default-value": false}], - "name": "ack"}, - {"id": 100, - "arguments": [{"type": "longlong", "name": "delivery-tag"}, - {"type": "bit", "name": "requeue", "default-value": true}], - "name": "reject"}], - "name": "file", - "properties": [{"type": "shortstr", "name": "content-type"}, - {"type": "shortstr", "name": "content-encoding"}, - {"type": "table", "name": "headers"}, - {"type": "octet", "name": "priority"}, - {"type": "shortstr", "name": "reply-to"}, - {"type": "shortstr", "name": "message-id"}, - {"type": "shortstr", "name": "filename"}, - {"type": "timestamp", "name": "timestamp"}, - {"type": "shortstr", "name": "cluster-id"}] - }, - { - "id": 80, - "methods": [{"id": 10, - "arguments": [{"type": "long", "name": "prefetch-size", "default-value": 0}, - {"type": "short", "name": "prefetch-count", "default-value": 0}, - {"type": "long", "name": "consume-rate", "default-value": 0}, - {"type": "bit", "name": "global", "default-value": false}], - "name": "qos", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "qos-ok"}, - {"id": 20, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue"}, - {"type": "shortstr", "name": "consumer-tag", "default-value": ""}, - {"type": "bit", "name": "no-local", "default-value": false}, - {"type": "bit", "name": "exclusive", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "consume", - "synchronous" : true}, - {"id": 21, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}], - "name": "consume-ok"}, - {"id": 30, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "cancel", - "synchronous" : true}, - {"id": 31, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}], - "name": "cancel-ok"}, - {"content": true, - "id": 40, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "exchange", "default-value": ""}, - {"type": "shortstr", "name": "routing-key", "default-value": ""}, - {"type": "bit", "name": "mandatory", "default-value": false}, - {"type": "bit", "name": "immediate", "default-value": false}], - "name": "publish"}, - {"content": true, - "id": 50, - "arguments": [{"type": "short", "name": "reply-code", "default-value": 200}, - {"type": "shortstr", "name": "reply-text", "default-value": ""}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key"}], - "name": "return"}, - {"content": true, - "id": 60, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}, - {"type": "longlong", "name": "delivery-tag"}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "queue"}], - "name": "deliver"}], - "name": "stream", - "properties": [{"type": "shortstr", "name": "content-type"}, - {"type": "shortstr", "name": "content-encoding"}, - {"type": "table", "name": "headers"}, - {"type": "octet", "name": "priority"}, - {"type": "timestamp", "name": "timestamp"}] - }, - { - "id": 90, - "methods": [{"id": 10, - "arguments": [], - "name": "select", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "select-ok"}, - {"id": 20, - "arguments": [], - "name": "commit", - "synchronous" : true}, - {"id": 21, - "arguments": [], - "name": "commit-ok"}, - {"id": 30, - "arguments": [], - "name": "rollback", - "synchronous" : true}, - {"id": 31, - "arguments": [], - "name": "rollback-ok"}], - "name": "tx" - }, - { - "id": 100, - "methods": [{"id": 10, - "arguments": [], - "name": "select", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "select-ok"}, - {"id": 20, - "arguments": [{"type": "shortstr", "name": "dtx-identifier"}], - "name": "start", - "synchronous" : true}, - {"id": 21, - "arguments": [], "name": "start-ok"}], - "name": "dtx" - }, - { - "id": 110, - "methods": [{"content": true, - "id": 10, - "arguments": [{"type": "table", "name": "meta-data"}], - "name": "request"}], - "name": "tunnel", - "properties": [{"type": "table", "name": "headers"}, - {"type": "shortstr", "name": "proxy-name"}, - {"type": "shortstr", "name": "data-name"}, - {"type": "octet", "name": "durable"}, - {"type": "octet", "name": "broadcast"}] - }, - { - "id": 120, - "methods": [{"id": 10, - "arguments": [{"type": "octet", "name": "integer-1"}, - {"type": "short", "name": "integer-2"}, - {"type": "long", "name": "integer-3"}, - {"type": "longlong", "name": "integer-4"}, - {"type": "octet", "name": "operation"}], - "name": "integer", - "synchronous" : true}, - {"id": 11, - "arguments": [{"type": "longlong", "name": "result"}], - "name": "integer-ok"}, - {"id": 20, - "arguments": [{"type": "shortstr", "name": "string-1"}, - {"type": "longstr", "name": "string-2"}, - {"type": "octet", "name": "operation"}], - "name": "string", - "synchronous" : true}, - {"id": 21, - "arguments": [{"type": "longstr", "name": "result"}], - "name": "string-ok"}, - {"id": 30, - "arguments": [{"type": "table", "name": "table"}, - {"type": "octet", "name": "integer-op"}, - {"type": "octet", "name": "string-op"}], - "name": "table", - "synchronous" : true}, - {"id": 31, - "arguments": [{"type": "longlong", "name": "integer-result"}, - {"type": "longstr", "name": "string-result"}], - "name": "table-ok"}, - {"content": true, - "id": 40, - "arguments": [], - "name": "content", - "synchronous" : true}, - {"content": true, - "id": 41, - "arguments": [{"type": "long", "name": "content-checksum"}], - "name": "content-ok"}], - "name": "test" - } - ] -} diff --git a/amqp-rabbitmq-0.9.1.json b/amqp-rabbitmq-0.9.1.json deleted file mode 100644 index 9036e8d..0000000 --- a/amqp-rabbitmq-0.9.1.json +++ /dev/null @@ -1,1412 +0,0 @@ -{ - "name": "AMQP", - "major-version": 0, - "minor-version": 9, - "revision": 1, - "port": 5672, - "copyright": [ - "Copyright (C) 2008-2009 LShift Ltd, Cohesive Financial Technologies LLC,\n", - "and Rabbit Technologies Ltd\n", - "\n", - "Permission is hereby granted, free of charge, to any person\n", - "obtaining a copy of this file (the \"Software\"), to deal in the\n", - "Software without restriction, including without limitation the \n", - "rights to use, copy, modify, merge, publish, distribute, \n", - "sublicense, and/or sell copies of the Software, and to permit \n", - "persons to whom the Software is furnished to do so, subject to \n", - "the following conditions:\n", - "\n", - "The above copyright notice and this permission notice shall be\n", - "included in all copies or substantial portions of the Software.\n", - "\n", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n", - "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n", - "OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n", - "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n", - "HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n", - "WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n", - "FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n", - "OTHER DEALINGS IN THE SOFTWARE.\n", - "\n", - "Class information entered from amqp_xml0-8.pdf and domain types from amqp-xml-doc0-9.pdf\n", - "Updated for 0-9-1 by Tony Garnock-Jones\n", - "\n", - "b3cb053f15e7b98808c0ccc67f23cb3e amqp_xml0-8.pdf\n", - "http://www.twiststandards.org/index.php?option=com_docman&task=cat_view&gid=28&&Itemid=90\n", - "8444db91e2949dbecfb2585e9eef6d64 amqp-xml-doc0-9.pdf\n", - "https://jira.amqp.org/confluence/download/attachments/720900/amqp-xml-doc0-9.pdf?version=1\n"], - - "domains": [ - ["bit", "bit"], - ["channel-id", "longstr"], - ["class-id", "short"], - ["consumer-tag", "shortstr"], - ["delivery-tag", "longlong"], - ["destination", "shortstr"], - ["duration", "longlong"], - ["exchange-name", "shortstr"], - ["long", "long"], - ["longlong", "longlong"], - ["longstr", "longstr"], - ["method-id", "short"], - ["no-ack", "bit"], - ["no-local", "bit"], - ["octet", "octet"], - ["offset", "longlong"], - ["path", "shortstr"], - ["peer-properties", "table"], - ["queue-name", "shortstr"], - ["redelivered", "bit"], - ["reference", "longstr"], - ["reject-code", "short"], - ["reject-text", "shortstr"], - ["reply-code", "short"], - ["reply-text", "shortstr"], - ["security-token", "longstr"], - ["short", "short"], - ["shortstr", "shortstr"], - ["table", "table"], - ["timestamp", "timestamp"] - ], - - "constants": [ - {"name": "FRAME-METHOD", "value": 1}, - {"name": "FRAME-HEADER", "value": 2}, - {"name": "FRAME-BODY", "value": 3}, - {"name": "FRAME-HEARTBEAT", "value": 8}, - {"name": "FRAME-MIN-SIZE", "value": 4096}, - {"name": "FRAME-END", "value": 206}, - {"name": "REPLY-SUCCESS", "value": 200}, - {"name": "CONTENT-TOO-LARGE", "value": 311, "class": "soft-error"}, - {"name": "NO-ROUTE", "value": 312, "class": "soft-error"}, - {"name": "NO-CONSUMERS", "value": 313, "class": "soft-error"}, - {"name": "ACCESS-REFUSED", "value": 403, "class": "soft-error"}, - {"name": "NOT-FOUND", "value": 404, "class": "soft-error"}, - {"name": "RESOURCE-LOCKED", "value": 405, "class": "soft-error"}, - {"name": "PRECONDITION-FAILED", "value": 406, "class": "soft-error"}, - {"name": "CONNECTION-FORCED", "value": 320, "class": "hard-error"}, - {"name": "INVALID-PATH", "value": 402, "class": "hard-error"}, - {"name": "FRAME-ERROR", "value": 501, "class": "hard-error"}, - {"name": "SYNTAX-ERROR", "value": 502, "class": "hard-error"}, - {"name": "COMMAND-INVALID", "value": 503, "class": "hard-error"}, - {"name": "CHANNEL-ERROR", "value": 504, "class": "hard-error"}, - {"name": "UNEXPECTED-FRAME", "value": 505, "class": "hard-error"}, - {"name": "RESOURCE-ERROR", "value": 506, "class": "hard-error"}, - {"name": "NOT-ALLOWED", "value": 530, "class": "hard-error"}, - {"name": "NOT-IMPLEMENTED", "value": 540, "class": "hard-error"}, - {"name": "INTERNAL-ERROR", "value": 541, "class": "hard-error"} - ], - - "classes": [ - { - "properties": [], - "id": 10, - "name": "connection", - "methods": [ - { - "accepted-by": [ - "client" - ], - "synchronous": true, - "id": 10, - "name": "start", - "arguments": [ - { - "type": "octet", - "name": "version-major", - "default-value": 0 - }, - { - "type": "octet", - "name": "version-minor", - "default-value": 9 - }, - { - "domain": "peer-properties", - "name": "server properties" - }, - { - "type": "longstr", - "name": "mechanisms", - "default-value": "PLAIN" - }, - { - "type": "longstr", - "name": "locales", - "default-value": "en_US" - } - ] - }, - { - "accepted-by": [ - "server" - ], - "id": 11, - "name": "start-ok", - "arguments": [ - { - "domain": "peer-properties", - "name": "client-properties" - }, - { - "type": "shortstr", - "name": "mechanism", - "default-value": "PLAIN" - }, - { - "type": "longstr", - "name": "response" - }, - { - "type": "shortstr", - "name": "locale", - "default-value": "en_US" - } - ] - }, - { - "accepted-by": [ - "client" - ], - "synchronous": true, - "id": 20, - "name": "secure", - "arguments": [ - { - "type": "longstr", - "name": "challenge" - } - ] - }, - { - "accepted-by": [ - "server" - ], - "id": 21, - "name": "secure-ok", - "arguments": [ - { - "type": "longstr", - "name": "response" - } - ] - }, - { - "accepted-by": [ - "client" - ], - "synchronous": true, - "id": 30, - "name": "tune", - "arguments": [ - { - "type": "short", - "name": "channel-max", - "default-value": 0 - }, - { - "type": "long", - "name": "frame-max", - "default-value": 0 - }, - { - "type": "short", - "name": "heartbeat", - "default-value": 0 - } - ] - }, - { - "accepted-by": [ - "server" - ], - "id": 31, - "name": "tune-ok", - "arguments": [ - { - "type": "short", - "name": "channel-max", - "default-value": 0 - }, - { - "type": "long", - "name": "frame-max", - "default-value": 0 - }, - { - "type": "short", - "name": "heartbeat", - "default-value": 0 - } - ] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 40, - "name": "open", - "arguments": [ - { - "type": "shortstr", - "name": "virtual-host", - "default-value": "/" - }, - { - "type": "shortstr", - "name": "capabilities", - "default-value": "" - }, - { - "type": "bit", - "name": "insist", - "default-value": false - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 41, - "name": "open-ok", - "arguments": [ - { - "type": "shortstr", - "name": "known-hosts", - "default-value": "" - } - ] - }, - { - "accepted-by": [ - "client", - "server" - ], - "synchronous": true, - "id": 50, - "name": "close", - "arguments": [ - { - "type": "short", - "name": "reply-code" - }, - { - "type": "shortstr", - "name": "reply-text", - "default-value": "" - }, - { - "type": "short", - "name": "class-id" - }, - { - "type": "short", - "name": "method-id" - } - ] - }, - { - "accepted-by": [ - "client", - "server" - ], - "id": 51, - "name": "close-ok", - "arguments": [] - } - ] - }, - { - "id": 20, - "name": "channel", - "methods": [ - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 10, - "name": "open", - "arguments": [ - { - "type": "shortstr", - "name": "out-of-band", - "default-value": "" - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 11, - "name": "open-ok", - "arguments": [ - { - "type": "longstr", - "name": "channel-id", - "default-value": "" - } - ] - }, - { - "accepted-by": [ - "server", - "client" - ], - "synchronous": true, - "id": 20, - "name": "flow", - "arguments": [ - { - "type": "bit", - "name": "active" - } - ] - }, - { - "accepted-by": [ - "server", - "client" - ], - "id": 21, - "name": "flow-ok", - "arguments": [ - { - "type": "bit", - "name": "active" - } - ] - }, - { - "accepted-by": [ - "client", - "server" - ], - "synchronous": true, - "id": 40, - "name": "close", - "arguments": [ - { - "type": "short", - "name": "reply-code" - }, - { - "type": "shortstr", - "name": "reply-text", - "default-value": "" - }, - { - "type": "short", - "name": "class-id" - }, - { - "type": "short", - "name": "method-id" - } - ] - }, - { - "accepted-by": [ - "client", - "server" - ], - "id": 41, - "name": "close-ok", - "arguments": [] - } - ] - }, - { - "id": 30, - "name": "access", - "methods": [ - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 10, - "name": "request", - "arguments": [ - { - "type": "shortstr", - "name": "realm", - "default-value": "/data" - }, - { - "type": "bit", - "name": "exclusive", - "default-value": false - }, - { - "type": "bit", - "name": "passive", - "default-value": true - }, - { - "type": "bit", - "name": "active", - "default-value": true - }, - { - "type": "bit", - "name": "write", - "default-value": true - }, - { - "type": "bit", - "name": "read", - "default-value": true - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 11, - "name": "request-ok", - "arguments": [ - { - "type": "short", - "name": "ticket", - "default-value": 1 - } - ] - } - ] - }, - { - "id": 40, - "name": "exchange", - "methods": [ - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 10, - "name": "declare", - "arguments": [ - { - "type": "short", - "name": "ticket", - "default-value": 0 - }, - { - "type": "shortstr", - "name": "exchange" - }, - { - "type": "shortstr", - "name": "type", - "default-value": "direct" - }, - { - "type": "bit", - "name": "passive", - "default-value": false - }, - { - "type": "bit", - "name": "durable", - "default-value": false - }, - { - "type": "bit", - "name": "auto-delete", - "default-value": false - }, - { - "type": "bit", - "name": "internal", - "default-value": false - }, - { - "type": "bit", - "name": "nowait", - "default-value": false - }, - { - "type": "table", - "name": "arguments", - "default-value": {} - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 11, - "name": "declare-ok", - "arguments": [] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 20, - "name": "delete", - "arguments": [ - { - "type": "short", - "name": "ticket", - "default-value": 0 - }, - { - "type": "shortstr", - "name": "exchange" - }, - { - "type": "bit", - "name": "if-unused", - "default-value": false - }, - { - "type": "bit", - "name": "nowait", - "default-value": false - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 21, - "name": "delete-ok", - "arguments": [] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 30, - "name": "bind", - "arguments": [ - { - "type": "short", - "name": "ticket", - "default-value": 0 - }, - { - "type": "shortstr", - "name": "destination" - }, - { - "type": "shortstr", - "name": "source" - }, - { - "type": "shortstr", - "name": "routing-key", - "default-value": "" - }, - { - "type": "bit", - "name": "nowait", - "default-value": false - }, - { - "type": "table", - "name": "arguments", - "default-value": {} - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 31, - "name": "bind-ok", - "arguments": [] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 40, - "name": "unbind", - "arguments": [ - { - "type": "short", - "name": "ticket", - "default-value": 0 - }, - { - "type": "shortstr", - "name": "destination" - }, - { - "type": "shortstr", - "name": "source" - }, - { - "type": "shortstr", - "name": "routing-key", - "default-value": "" - }, - { - "type": "bit", - "name": "nowait", - "default-value": false - }, - { - "type": "table", - "name": "arguments", - "default-value": {} - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 51, - "name": "unbind-ok", - "arguments": [] - } - ] - }, - { - "id": 50, - "name": "queue", - "methods": [ - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 10, - "name": "declare", - "arguments": [ - { - "type": "short", - "name": "ticket", - "default-value": 0 - }, - { - "type": "shortstr", - "name": "queue", - "default-value": "" - }, - { - "type": "bit", - "name": "passive", - "default-value": false - }, - { - "type": "bit", - "name": "durable", - "default-value": false - }, - { - "type": "bit", - "name": "exclusive", - "default-value": false - }, - { - "type": "bit", - "name": "auto-delete", - "default-value": false - }, - { - "type": "bit", - "name": "nowait", - "default-value": false - }, - { - "type": "table", - "name": "arguments", - "default-value": {} - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 11, - "name": "declare-ok", - "arguments": [ - { - "type": "shortstr", - "name": "queue" - }, - { - "type": "long", - "name": "message-count" - }, - { - "type": "long", - "name": "consumer-count" - } - ] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 20, - "name": "bind", - "arguments": [ - { - "type": "short", - "name": "ticket", - "default-value": 0 - }, - { - "type": "shortstr", - "name": "queue" - }, - { - "type": "shortstr", - "name": "exchange" - }, - { - "type": "shortstr", - "name": "routing-key", - "default-value": "" - }, - { - "type": "bit", - "name": "nowait", - "default-value": false - }, - { - "type": "table", - "name": "arguments", - "default-value": {} - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 21, - "name": "bind-ok", - "arguments": [] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 30, - "name": "purge", - "arguments": [ - { - "type": "short", - "name": "ticket", - "default-value": 0 - }, - { - "type": "shortstr", - "name": "queue" - }, - { - "type": "bit", - "name": "nowait", - "default-value": false - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 31, - "name": "purge-ok", - "arguments": [ - { - "type": "long", - "name": "message-count" - } - ] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 40, - "name": "delete", - "arguments": [ - { - "type": "short", - "name": "ticket", - "default-value": 0 - }, - { - "type": "shortstr", - "name": "queue" - }, - { - "type": "bit", - "name": "if-unused", - "default-value": false - }, - { - "type": "bit", - "name": "if-empty", - "default-value": false - }, - { - "type": "bit", - "name": "nowait", - "default-value": false - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 41, - "name": "delete-ok", - "arguments": [ - { - "type": "long", - "name": "message-count" - } - ] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 50, - "name": "unbind", - "arguments": [ - { - "type": "short", - "name": "ticket", - "default-value": 0 - }, - { - "type": "shortstr", - "name": "queue" - }, - { - "type": "shortstr", - "name": "exchange" - }, - { - "type": "shortstr", - "name": "routing-key", - "default-value": "" - }, - { - "type": "table", - "name": "arguments", - "default-value": {} - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 51, - "name": "unbind-ok", - "arguments": [] - } - ] - }, - { - "properties": [ - { - "type": "shortstr", - "name": "content-type" - }, - { - "type": "shortstr", - "name": "content-encoding" - }, - { - "type": "table", - "name": "headers" - }, - { - "type": "octet", - "name": "delivery-mode" - }, - { - "type": "octet", - "name": "priority" - }, - { - "type": "shortstr", - "name": "correlation-id" - }, - { - "type": "shortstr", - "name": "reply-to" - }, - { - "type": "shortstr", - "name": "expiration" - }, - { - "type": "shortstr", - "name": "message-id" - }, - { - "type": "timestamp", - "name": "timestamp" - }, - { - "type": "shortstr", - "name": "type" - }, - { - "type": "shortstr", - "name": "user-id" - }, - { - "type": "shortstr", - "name": "app-id" - }, - { - "type": "shortstr", - "name": "cluster-id" - } - ], - "id": 60, - "name": "basic", - "methods": [ - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 10, - "name": "qos", - "arguments": [ - { - "type": "long", - "name": "prefetch-size", - "default-value": 0 - }, - { - "type": "short", - "name": "prefetch-count", - "default-value": 0 - }, - { - "type": "bit", - "name": "global", - "default-value": false - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 11, - "name": "qos-ok", - "arguments": [] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 20, - "name": "consume", - "arguments": [ - { - "domain": "short", - "name": "ticket", - "default-value": 0 - }, - { - "domain": "queue-name", - "name": "queue" - }, - { - "type": "shortstr", - "name": "consumer-tag", - "default-value": "" - }, - { - "type": "bit", - "name": "no-local", - "default-value": false - }, - { - "type": "bit", - "name": "no-ack", - "default-value": false - }, - { - "type": "bit", - "name": "exclusive", - "default-value": false - }, - { - "type": "bit", - "name": "nowait", - "default-value": false - }, - { - "type": "table", - "name": "arguments", - "default-value": {} - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 21, - "name": "consume-ok", - "arguments": [ - { - "type": "shortstr", - "name": "consumer-tag" - } - ] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 30, - "name": "cancel", - "arguments": [ - { - "type": "shortstr", - "name": "consumer-tag" - }, - { - "type": "bit", - "name": "nowait", - "default-value": false - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 31, - "name": "cancel-ok", - "arguments": [ - { - "type": "shortstr", - "name": "consumer-tag" - } - ] - }, - { - "content": true, - "accepted-by": [ - "server" - ], - "id": 40, - "name": "publish", - "arguments": [ - { - "type": "short", - "name": "ticket", - "default-value": 0 - }, - { - "type": "shortstr", - "name": "exchange", - "default-value": "" - }, - { - "type": "shortstr", - "name": "routing-key", - "default-value": "" - }, - { - "type": "bit", - "name": "mandatory", - "default-value": false - }, - { - "type": "bit", - "name": "immediate", - "default-value": false - } - ] - }, - { - "content": true, - "accepted-by": [ - "client" - ], - "id": 50, - "name": "return", - "arguments": [ - { - "type": "short", - "name": "reply-code" - }, - { - "type": "shortstr", - "name": "reply-text", - "default-value": "" - }, - { - "type": "shortstr", - "name": "exchange" - }, - { - "type": "shortstr", - "name": "routing-key" - } - ] - }, - { - "content": true, - "accepted-by": [ - "client" - ], - "id": 60, - "name": "deliver", - "arguments": [ - { - "type": "shortstr", - "name": "consumer-tag" - }, - { - "type": "longlong", - "name": "delivery-tag" - }, - { - "type": "bit", - "name": "redelivered", - "default-value": false - }, - { - "type": "shortstr", - "name": "exchange" - }, - { - "type": "shortstr", - "name": "routing-key" - } - ] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 70, - "name": "get", - "arguments": [ - { - "type": "short", - "name": "ticket", - "default-value": 0 - }, - { - "type": "shortstr", - "name": "queue" - }, - { - "type": "bit", - "name": "no-ack", - "default-value": false - } - ] - }, - { - "content": true, - "accepted-by": [ - "client" - ], - "id": 71, - "name": "get-ok", - "arguments": [ - { - "type": "longlong", - "name": "delivery-tag" - }, - { - "type": "bit", - "name": "redelivered", - "default-value": false - }, - { - "type": "shortstr", - "name": "exchange" - }, - { - "type": "shortstr", - "name": "routing-key" - }, - { - "type": "long", - "name": "message-count" - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 72, - "name": "get-empty", - "arguments": [ - { - "type": "shortstr", - "name": "cluster-id", - "default-value": "" - } - ] - }, - { - "accepted-by": [ - "server" - ], - "id": 80, - "name": "ack", - "arguments": [ - { - "type": "longlong", - "name": "delivery-tag", - "default-value": 0 - }, - { - "type": "bit", - "name": "multiple", - "default-value": false - } - ] - }, - { - "accepted-by": [ - "server" - ], - "id": 90, - "name": "reject", - "arguments": [ - { - "type": "longlong", - "name": "delivery-tag" - }, - { - "type": "bit", - "name": "requeue", - "default-value": true - } - ] - }, - { - "accepted-by": [ - "server" - ], - "id": 100, - "name": "recover-async", - "arguments": [ - { - "type": "bit", - "name": "requeue", - "default-value": false - } - ] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 110, - "name": "recover", - "arguments": [ - { - "type": "bit", - "name": "requeue", - "default-value": false - } - ] - }, - { - "accepted-by": [ - "client" - ], - "id": 111, - "name": "recover-ok", - "arguments": [] - } - ] - }, - { - "id": 90, - "name": "tx", - "methods": [ - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 10, - "name": "select", - "arguments": [] - }, - { - "accepted-by": [ - "client" - ], - "id": 11, - "name": "select-ok", - "arguments": [] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 20, - "name": "commit", - "arguments": [] - }, - { - "accepted-by": [ - "client" - ], - "id": 21, - "name": "commit-ok", - "arguments": [] - }, - { - "accepted-by": [ - "server" - ], - "synchronous": true, - "id": 30, - "name": "rollback", - "arguments": [] - }, - { - "accepted-by": [ - "client" - ], - "id": 31, - "name": "rollback-ok", - "arguments": [] - } - ] - } - ] -} diff --git a/amqp_codegen.py b/amqp_codegen.py deleted file mode 100644 index 9be2cad..0000000 --- a/amqp_codegen.py +++ /dev/null @@ -1,305 +0,0 @@ -## The contents of this file are subject to the Mozilla Public License -## Version 1.1 (the "License"); you may not use this file except in -## compliance with the License. You may obtain a copy of the License at -## http://www.mozilla.org/MPL/ -## -## Software distributed under the License is distributed on an "AS IS" -## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -## License for the specific language governing rights and limitations -## under the License. -## -## The Original Code is RabbitMQ. -## -## The Initial Developers of the Original Code are LShift Ltd, -## Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. -## -## Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, -## Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd -## are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial -## Technologies LLC, and Rabbit Technologies Ltd. -## -## Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift -## Ltd. Portions created by Cohesive Financial Technologies LLC are -## Copyright (C) 2007-2009 Cohesive Financial Technologies -## LLC. Portions created by Rabbit Technologies Ltd are Copyright -## (C) 2007-2009 Rabbit Technologies Ltd. -## -## All Rights Reserved. -## -## Contributor(s): ______________________________________. -## - -from __future__ import nested_scopes -import re -import sys -from os import remove -from optparse import OptionParser - -try: - try: - import simplejson as json - except ImportError, e: - if sys.hexversion >= 0x20600f0: - import json - else: - raise e -except ImportError: - print >> sys.stderr , " You don't appear to have simplejson.py installed" - print >> sys.stderr , " (an implementation of a JSON reader and writer in Python)." - print >> sys.stderr , " You can install it:" - print >> sys.stderr , " - by running 'apt-get install python-simplejson' on Debian-based systems," - print >> sys.stderr , " - by running 'yum install python-simplejson' on Fedora/Red Hat system," - print >> sys.stderr , " - by running 'port install py25-simplejson' on Macports on OS X" - print >> sys.stderr , " (you may need to say 'make PYTHON=python2.5', as well)," - print >> sys.stderr , " - from sources from 'http://pypi.python.org/pypi/simplejson'" - print >> sys.stderr , " - simplejson is a standard json library in the Python core since 2.6" - sys.exit(1) - -def insert_base_types(d): - for t in ['octet', 'shortstr', 'longstr', 'short', 'long', - 'longlong', 'bit', 'table', 'timestamp']: - d[t] = t - -class AmqpSpecFileMergeConflict(Exception): pass - -# If ignore_conflicts is true, then we allow acc and new to conflict, -# with whatever's already in acc winning and new being ignored. If -# ignore_conflicts is false, acc and new must not conflict. - -def default_spec_value_merger(key, acc, new, ignore_conflicts): - if acc is None or acc == new or ignore_conflicts: - return new - else: - raise AmqpSpecFileMergeConflict(key, acc, new) - -def extension_info_merger(key, acc, new, ignore_conflicts): - return acc + [new] - -def domains_merger(key, acc, new, ignore_conflicts): - merged = dict((k, v) for [k, v] in acc) - for [k, v] in new: - if merged.has_key(k): - if not ignore_conflicts: - raise AmqpSpecFileMergeConflict(key, acc, new) - else: - merged[k] = v - - return [[k, v] for (k, v) in merged.iteritems()] - -def merge_dict_lists_by(dict_key, acc, new, ignore_conflicts): - acc_index = set(v[dict_key] for v in acc) - result = list(acc) # shallow copy - for v in new: - if v[dict_key] in acc_index: - if not ignore_conflicts: - raise AmqpSpecFileMergeConflict(description, acc, new) - else: - result.append(v) - return result - -def constants_merger(key, acc, new, ignore_conflicts): - return merge_dict_lists_by("name", acc, new, ignore_conflicts) - -def methods_merger(classname, acc, new, ignore_conflicts): - return merge_dict_lists_by("name", acc, new, ignore_conflicts) - -def properties_merger(classname, acc, new, ignore_conflicts): - return merge_dict_lists_by("name", acc, new, ignore_conflicts) - -def class_merger(acc, new, ignore_conflicts): - acc["methods"] = methods_merger(acc["name"], - acc["methods"], - new["methods"], - ignore_conflicts) - acc["properties"] = properties_merger(acc["name"], - acc.get("properties", []), - new.get("properties", []), - ignore_conflicts) - -def classes_merger(key, acc, new, ignore_conflicts): - acc_dict = dict((v["name"], v) for v in acc) - result = list(acc) # shallow copy - for w in new: - if w["name"] in acc_dict: - class_merger(acc_dict[w["name"]], w, ignore_conflicts) - else: - result.append(w) - return result - -mergers = { - "extension": (extension_info_merger, []), - "domains": (domains_merger, []), - "constants": (constants_merger, []), - "classes": (classes_merger, []), -} - -def merge_load_specs(filenames, ignore_conflicts): - handles = [file(filename) for filename in filenames] - docs = [json.load(handle) for handle in handles] - spec = {} - for doc in docs: - for (key, value) in doc.iteritems(): - (merger, default_value) = mergers.get(key, (default_spec_value_merger, None)) - spec[key] = merger(key, spec.get(key, default_value), value, ignore_conflicts) - for handle in handles: handle.close() - return spec - -class AmqpSpec: - # Slight wart: use a class member rather than change the ctor signature - # to avoid breaking everyone else's code. - ignore_conflicts = False - - def __init__(self, filenames): - self.spec = merge_load_specs(filenames, AmqpSpec.ignore_conflicts) - - self.major = self.spec['major-version'] - self.minor = self.spec['minor-version'] - self.revision = self.spec.has_key('revision') and self.spec['revision'] or 0 - self.port = self.spec['port'] - - self.domains = {} - insert_base_types(self.domains) - for entry in self.spec['domains']: - self.domains[ entry[0] ] = entry[1] - - self.constants = [] - for d in self.spec['constants']: - if d.has_key('class'): - klass = d['class'] - else: - klass = '' - self.constants.append((d['name'], d['value'], klass)) - - self.classes = [] - for element in self.spec['classes']: - self.classes.append(AmqpClass(self.spec, element)) - - def allClasses(self): - return self.classes - - def allMethods(self): - return [m for c in self.classes for m in c.allMethods()] - - def resolveDomain(self, n): - return self.domains[n] - -class AmqpEntity: - def __init__(self, element): - self.element = element - self.name = element['name'] - -class AmqpClass(AmqpEntity): - def __init__(self, spec, element): - AmqpEntity.__init__(self, element) - self.spec = spec - self.index = int(self.element['id']) - - self.methods = [] - for method_element in self.element['methods']: - self.methods.append(AmqpMethod(self, method_element)) - - self.hasContentProperties = False - for method in self.methods: - if method.hasContent: - self.hasContentProperties = True - break - - self.fields = [] - if self.element.has_key('properties'): - index = 0 - for e in self.element['properties']: - self.fields.append(AmqpField(self, e, index)) - index = index + 1 - - def allMethods(self): - return self.methods - - def __repr__(self): - return 'AmqpClass("' + self.name + '")' - -class AmqpMethod(AmqpEntity): - def __init__(self, klass, element): - AmqpEntity.__init__(self, element) - self.klass = klass - self.index = int(self.element['id']) - if self.element.has_key('synchronous'): - self.isSynchronous = self.element['synchronous'] - else: - self.isSynchronous = False - if self.element.has_key('content'): - self.hasContent = self.element['content'] - else: - self.hasContent = False - if self.element.has_key('accepted-by'): - self.acceptedBy = self.element['accepted-by'] - else: - self.acceptedBy = [] - self.arguments = [] - - index = 0 - for argument in element['arguments']: - self.arguments.append(AmqpField(self, argument, index)) - index = index + 1 - - def __repr__(self): - return 'AmqpMethod("' + self.klass.name + "." + self.name + '" ' + repr(self.arguments) + ')' - -class AmqpField(AmqpEntity): - def __init__(self, method, element, index): - AmqpEntity.__init__(self, element) - self.method = method - self.index = index - - if self.element.has_key('type'): - self.domain = self.element['type'] - else: - self.domain = self.element['domain'] - - if self.element.has_key('default-value'): - self.defaultvalue = self.element['default-value'] - else: - self.defaultvalue = None - - def __repr__(self): - return 'AmqpField("' + self.name + '")' - -def do_main(header_fn, body_fn): - do_main_dict({"header": header_fn, "body": body_fn}) - -def do_main_dict(funcDict): - def usage(): - print >> sys.stderr , "Usage:" - print >> sys.stderr , " %s <function> <path_to_amqp_spec.json>... <path_to_output_file>" % (sys.argv[0]) - print >> sys.stderr , " where <function> is one of %s" % ", ".join([k for k in funcDict.keys()]) - - def execute(fn, amqp_specs, out_file): - stdout = sys.stdout - f = open(out_file, 'w') - try: - try: - sys.stdout = f - fn(amqp_specs) - except: - remove(out_file) - raise - finally: - sys.stdout = stdout - f.close() - - parser = OptionParser() - parser.add_option("--ignore-conflicts", action="store_true", dest="ignore_conflicts", default=False) - (options, args) = parser.parse_args() - - if len(args) < 3: - usage() - sys.exit(1) - else: - function = args[0] - sources = args[1:-1] - dest = args[-1] - AmqpSpec.ignore_conflicts = options.ignore_conflicts - if funcDict.has_key(function): - execute(funcDict[function], sources, dest) - else: - usage() - sys.exit(1) diff --git a/demo_extension.json b/demo_extension.json deleted file mode 100644 index 38ed2a4..0000000 --- a/demo_extension.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extension": { - "name": "demo", - "version": "1.0", - "copyright": "Copyright (C) 2009 LShift Ltd." - }, - "domains": [ - ["foo-domain", "shortstr"] - ], - "constants": [ - {"name": "FOO-CONSTANT", "value": 121212} - ], - "classes": [ - {"name": "demo", - "id": 555, - "methods": [{"name": "one", "id": 1, "arguments": []}]} - ] -} |