123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319 |
- """
- AMQP Specification
- ==================
- This module implements the constants and classes that comprise AMQP protocol
- level constructs. It should rarely be directly referenced outside of Pika's
- own internal use.
- .. note:: Auto-generated code by codegen.py, do not edit directly. Pull
- requests to this file without accompanying ``utils/codegen.py`` changes will be
- rejected.
- """
- import struct
- from pika import amqp_object
- from pika import data
- from pika.compat import str_or_bytes, unicode_type
- # Python 3 support for str object
- str = bytes
- PROTOCOL_VERSION = (0, 9, 1)
- PORT = 5672
- ACCESS_REFUSED = 403
- CHANNEL_ERROR = 504
- COMMAND_INVALID = 503
- CONNECTION_FORCED = 320
- CONTENT_TOO_LARGE = 311
- FRAME_BODY = 3
- FRAME_END = 206
- FRAME_END_SIZE = 1
- FRAME_ERROR = 501
- FRAME_HEADER = 2
- FRAME_HEADER_SIZE = 7
- FRAME_HEARTBEAT = 8
- FRAME_MAX_SIZE = 131072
- FRAME_METHOD = 1
- FRAME_MIN_SIZE = 4096
- INTERNAL_ERROR = 541
- INVALID_PATH = 402
- NOT_ALLOWED = 530
- NOT_FOUND = 404
- NOT_IMPLEMENTED = 540
- NO_CONSUMERS = 313
- NO_ROUTE = 312
- PERSISTENT_DELIVERY_MODE = 2
- PRECONDITION_FAILED = 406
- REPLY_SUCCESS = 200
- RESOURCE_ERROR = 506
- RESOURCE_LOCKED = 405
- SYNTAX_ERROR = 502
- TRANSIENT_DELIVERY_MODE = 1
- UNEXPECTED_FRAME = 505
- class Connection(amqp_object.Class):
- INDEX = 0x000A # 10
- NAME = 'Connection'
- class Start(amqp_object.Method):
- INDEX = 0x000A000A # 10, 10; 655370
- NAME = 'Connection.Start'
- def __init__(self, version_major=0, version_minor=9, server_properties=None, mechanisms='PLAIN', locales='en_US'):
- self.version_major = version_major
- self.version_minor = version_minor
- self.server_properties = server_properties
- self.mechanisms = mechanisms
- self.locales = locales
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.version_major = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.version_minor = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- (self.server_properties, offset) = data.decode_table(encoded, offset)
- length = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- self.mechanisms = encoded[offset:offset + length]
- try:
- self.mechanisms = str(self.mechanisms)
- except UnicodeEncodeError:
- pass
- offset += length
- length = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- self.locales = encoded[offset:offset + length]
- try:
- self.locales = str(self.locales)
- except UnicodeEncodeError:
- pass
- offset += length
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('B', self.version_major))
- pieces.append(struct.pack('B', self.version_minor))
- data.encode_table(pieces, self.server_properties)
- assert isinstance(self.mechanisms, str_or_bytes),\
- 'A non-string value was supplied for self.mechanisms'
- value = self.mechanisms.encode('utf-8') if isinstance(self.mechanisms, unicode_type) else self.mechanisms
- pieces.append(struct.pack('>I', len(value)))
- pieces.append(value)
- assert isinstance(self.locales, str_or_bytes),\
- 'A non-string value was supplied for self.locales'
- value = self.locales.encode('utf-8') if isinstance(self.locales, unicode_type) else self.locales
- pieces.append(struct.pack('>I', len(value)))
- pieces.append(value)
- return pieces
- class StartOk(amqp_object.Method):
- INDEX = 0x000A000B # 10, 11; 655371
- NAME = 'Connection.StartOk'
- def __init__(self, client_properties=None, mechanism='PLAIN', response=None, locale='en_US'):
- self.client_properties = client_properties
- self.mechanism = mechanism
- self.response = response
- self.locale = locale
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- (self.client_properties, offset) = data.decode_table(encoded, offset)
- self.mechanism, offset = data.decode_short_string(encoded, offset)
- length = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- self.response = encoded[offset:offset + length]
- try:
- self.response = str(self.response)
- except UnicodeEncodeError:
- pass
- offset += length
- self.locale, offset = data.decode_short_string(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- data.encode_table(pieces, self.client_properties)
- assert isinstance(self.mechanism, str_or_bytes),\
- 'A non-string value was supplied for self.mechanism'
- data.encode_short_string(pieces, self.mechanism)
- assert isinstance(self.response, str_or_bytes),\
- 'A non-string value was supplied for self.response'
- value = self.response.encode('utf-8') if isinstance(self.response, unicode_type) else self.response
- pieces.append(struct.pack('>I', len(value)))
- pieces.append(value)
- assert isinstance(self.locale, str_or_bytes),\
- 'A non-string value was supplied for self.locale'
- data.encode_short_string(pieces, self.locale)
- return pieces
- class Secure(amqp_object.Method):
- INDEX = 0x000A0014 # 10, 20; 655380
- NAME = 'Connection.Secure'
- def __init__(self, challenge=None):
- self.challenge = challenge
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- length = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- self.challenge = encoded[offset:offset + length]
- try:
- self.challenge = str(self.challenge)
- except UnicodeEncodeError:
- pass
- offset += length
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.challenge, str_or_bytes),\
- 'A non-string value was supplied for self.challenge'
- value = self.challenge.encode('utf-8') if isinstance(self.challenge, unicode_type) else self.challenge
- pieces.append(struct.pack('>I', len(value)))
- pieces.append(value)
- return pieces
- class SecureOk(amqp_object.Method):
- INDEX = 0x000A0015 # 10, 21; 655381
- NAME = 'Connection.SecureOk'
- def __init__(self, response=None):
- self.response = response
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- length = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- self.response = encoded[offset:offset + length]
- try:
- self.response = str(self.response)
- except UnicodeEncodeError:
- pass
- offset += length
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.response, str_or_bytes),\
- 'A non-string value was supplied for self.response'
- value = self.response.encode('utf-8') if isinstance(self.response, unicode_type) else self.response
- pieces.append(struct.pack('>I', len(value)))
- pieces.append(value)
- return pieces
- class Tune(amqp_object.Method):
- INDEX = 0x000A001E # 10, 30; 655390
- NAME = 'Connection.Tune'
- def __init__(self, channel_max=0, frame_max=0, heartbeat=0):
- self.channel_max = channel_max
- self.frame_max = frame_max
- self.heartbeat = heartbeat
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.channel_max = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.frame_max = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- self.heartbeat = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.channel_max))
- pieces.append(struct.pack('>I', self.frame_max))
- pieces.append(struct.pack('>H', self.heartbeat))
- return pieces
- class TuneOk(amqp_object.Method):
- INDEX = 0x000A001F # 10, 31; 655391
- NAME = 'Connection.TuneOk'
- def __init__(self, channel_max=0, frame_max=0, heartbeat=0):
- self.channel_max = channel_max
- self.frame_max = frame_max
- self.heartbeat = heartbeat
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.channel_max = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.frame_max = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- self.heartbeat = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.channel_max))
- pieces.append(struct.pack('>I', self.frame_max))
- pieces.append(struct.pack('>H', self.heartbeat))
- return pieces
- class Open(amqp_object.Method):
- INDEX = 0x000A0028 # 10, 40; 655400
- NAME = 'Connection.Open'
- def __init__(self, virtual_host='/', capabilities='', insist=False):
- self.virtual_host = virtual_host
- self.capabilities = capabilities
- self.insist = insist
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.virtual_host, offset = data.decode_short_string(encoded, offset)
- self.capabilities, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.insist = (bit_buffer & (1 << 0)) != 0
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.virtual_host, str_or_bytes),\
- 'A non-string value was supplied for self.virtual_host'
- data.encode_short_string(pieces, self.virtual_host)
- assert isinstance(self.capabilities, str_or_bytes),\
- 'A non-string value was supplied for self.capabilities'
- data.encode_short_string(pieces, self.capabilities)
- bit_buffer = 0
- if self.insist:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class OpenOk(amqp_object.Method):
- INDEX = 0x000A0029 # 10, 41; 655401
- NAME = 'Connection.OpenOk'
- def __init__(self, known_hosts=''):
- self.known_hosts = known_hosts
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.known_hosts, offset = data.decode_short_string(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.known_hosts, str_or_bytes),\
- 'A non-string value was supplied for self.known_hosts'
- data.encode_short_string(pieces, self.known_hosts)
- return pieces
- class Close(amqp_object.Method):
- INDEX = 0x000A0032 # 10, 50; 655410
- NAME = 'Connection.Close'
- def __init__(self, reply_code=None, reply_text='', class_id=None, method_id=None):
- self.reply_code = reply_code
- self.reply_text = reply_text
- self.class_id = class_id
- self.method_id = method_id
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.reply_code = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.reply_text, offset = data.decode_short_string(encoded, offset)
- self.class_id = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.method_id = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.reply_code))
- assert isinstance(self.reply_text, str_or_bytes),\
- 'A non-string value was supplied for self.reply_text'
- data.encode_short_string(pieces, self.reply_text)
- pieces.append(struct.pack('>H', self.class_id))
- pieces.append(struct.pack('>H', self.method_id))
- return pieces
- class CloseOk(amqp_object.Method):
- INDEX = 0x000A0033 # 10, 51; 655411
- NAME = 'Connection.CloseOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Blocked(amqp_object.Method):
- INDEX = 0x000A003C # 10, 60; 655420
- NAME = 'Connection.Blocked'
- def __init__(self, reason=''):
- self.reason = reason
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.reason, offset = data.decode_short_string(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.reason, str_or_bytes),\
- 'A non-string value was supplied for self.reason'
- data.encode_short_string(pieces, self.reason)
- return pieces
- class Unblocked(amqp_object.Method):
- INDEX = 0x000A003D # 10, 61; 655421
- NAME = 'Connection.Unblocked'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Channel(amqp_object.Class):
- INDEX = 0x0014 # 20
- NAME = 'Channel'
- class Open(amqp_object.Method):
- INDEX = 0x0014000A # 20, 10; 1310730
- NAME = 'Channel.Open'
- def __init__(self, out_of_band=''):
- self.out_of_band = out_of_band
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.out_of_band, offset = data.decode_short_string(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.out_of_band, str_or_bytes),\
- 'A non-string value was supplied for self.out_of_band'
- data.encode_short_string(pieces, self.out_of_band)
- return pieces
- class OpenOk(amqp_object.Method):
- INDEX = 0x0014000B # 20, 11; 1310731
- NAME = 'Channel.OpenOk'
- def __init__(self, channel_id=''):
- self.channel_id = channel_id
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- length = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- self.channel_id = encoded[offset:offset + length]
- try:
- self.channel_id = str(self.channel_id)
- except UnicodeEncodeError:
- pass
- offset += length
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.channel_id, str_or_bytes),\
- 'A non-string value was supplied for self.channel_id'
- value = self.channel_id.encode('utf-8') if isinstance(self.channel_id, unicode_type) else self.channel_id
- pieces.append(struct.pack('>I', len(value)))
- pieces.append(value)
- return pieces
- class Flow(amqp_object.Method):
- INDEX = 0x00140014 # 20, 20; 1310740
- NAME = 'Channel.Flow'
- def __init__(self, active=None):
- self.active = active
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.active = (bit_buffer & (1 << 0)) != 0
- return self
- def encode(self):
- pieces = list()
- bit_buffer = 0
- if self.active:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class FlowOk(amqp_object.Method):
- INDEX = 0x00140015 # 20, 21; 1310741
- NAME = 'Channel.FlowOk'
- def __init__(self, active=None):
- self.active = active
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.active = (bit_buffer & (1 << 0)) != 0
- return self
- def encode(self):
- pieces = list()
- bit_buffer = 0
- if self.active:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class Close(amqp_object.Method):
- INDEX = 0x00140028 # 20, 40; 1310760
- NAME = 'Channel.Close'
- def __init__(self, reply_code=None, reply_text='', class_id=None, method_id=None):
- self.reply_code = reply_code
- self.reply_text = reply_text
- self.class_id = class_id
- self.method_id = method_id
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.reply_code = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.reply_text, offset = data.decode_short_string(encoded, offset)
- self.class_id = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.method_id = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.reply_code))
- assert isinstance(self.reply_text, str_or_bytes),\
- 'A non-string value was supplied for self.reply_text'
- data.encode_short_string(pieces, self.reply_text)
- pieces.append(struct.pack('>H', self.class_id))
- pieces.append(struct.pack('>H', self.method_id))
- return pieces
- class CloseOk(amqp_object.Method):
- INDEX = 0x00140029 # 20, 41; 1310761
- NAME = 'Channel.CloseOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Access(amqp_object.Class):
- INDEX = 0x001E # 30
- NAME = 'Access'
- class Request(amqp_object.Method):
- INDEX = 0x001E000A # 30, 10; 1966090
- NAME = 'Access.Request'
- def __init__(self, realm='/data', exclusive=False, passive=True, active=True, write=True, read=True):
- self.realm = realm
- self.exclusive = exclusive
- self.passive = passive
- self.active = active
- self.write = write
- self.read = read
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.realm, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.exclusive = (bit_buffer & (1 << 0)) != 0
- self.passive = (bit_buffer & (1 << 1)) != 0
- self.active = (bit_buffer & (1 << 2)) != 0
- self.write = (bit_buffer & (1 << 3)) != 0
- self.read = (bit_buffer & (1 << 4)) != 0
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.realm, str_or_bytes),\
- 'A non-string value was supplied for self.realm'
- data.encode_short_string(pieces, self.realm)
- bit_buffer = 0
- if self.exclusive:
- bit_buffer |= 1 << 0
- if self.passive:
- bit_buffer |= 1 << 1
- if self.active:
- bit_buffer |= 1 << 2
- if self.write:
- bit_buffer |= 1 << 3
- if self.read:
- bit_buffer |= 1 << 4
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class RequestOk(amqp_object.Method):
- INDEX = 0x001E000B # 30, 11; 1966091
- NAME = 'Access.RequestOk'
- def __init__(self, ticket=1):
- self.ticket = ticket
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- return pieces
- class Exchange(amqp_object.Class):
- INDEX = 0x0028 # 40
- NAME = 'Exchange'
- class Declare(amqp_object.Method):
- INDEX = 0x0028000A # 40, 10; 2621450
- NAME = 'Exchange.Declare'
- def __init__(self, ticket=0, exchange=None, type='direct', passive=False, durable=False, auto_delete=False, internal=False, nowait=False, arguments=None):
- self.ticket = ticket
- self.exchange = exchange
- self.type = type
- self.passive = passive
- self.durable = durable
- self.auto_delete = auto_delete
- self.internal = internal
- self.nowait = nowait
- self.arguments = arguments
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.exchange, offset = data.decode_short_string(encoded, offset)
- self.type, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.passive = (bit_buffer & (1 << 0)) != 0
- self.durable = (bit_buffer & (1 << 1)) != 0
- self.auto_delete = (bit_buffer & (1 << 2)) != 0
- self.internal = (bit_buffer & (1 << 3)) != 0
- self.nowait = (bit_buffer & (1 << 4)) != 0
- (self.arguments, offset) = data.decode_table(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- assert isinstance(self.exchange, str_or_bytes),\
- 'A non-string value was supplied for self.exchange'
- data.encode_short_string(pieces, self.exchange)
- assert isinstance(self.type, str_or_bytes),\
- 'A non-string value was supplied for self.type'
- data.encode_short_string(pieces, self.type)
- bit_buffer = 0
- if self.passive:
- bit_buffer |= 1 << 0
- if self.durable:
- bit_buffer |= 1 << 1
- if self.auto_delete:
- bit_buffer |= 1 << 2
- if self.internal:
- bit_buffer |= 1 << 3
- if self.nowait:
- bit_buffer |= 1 << 4
- pieces.append(struct.pack('B', bit_buffer))
- data.encode_table(pieces, self.arguments)
- return pieces
- class DeclareOk(amqp_object.Method):
- INDEX = 0x0028000B # 40, 11; 2621451
- NAME = 'Exchange.DeclareOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Delete(amqp_object.Method):
- INDEX = 0x00280014 # 40, 20; 2621460
- NAME = 'Exchange.Delete'
- def __init__(self, ticket=0, exchange=None, if_unused=False, nowait=False):
- self.ticket = ticket
- self.exchange = exchange
- self.if_unused = if_unused
- self.nowait = nowait
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.exchange, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.if_unused = (bit_buffer & (1 << 0)) != 0
- self.nowait = (bit_buffer & (1 << 1)) != 0
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- assert isinstance(self.exchange, str_or_bytes),\
- 'A non-string value was supplied for self.exchange'
- data.encode_short_string(pieces, self.exchange)
- bit_buffer = 0
- if self.if_unused:
- bit_buffer |= 1 << 0
- if self.nowait:
- bit_buffer |= 1 << 1
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class DeleteOk(amqp_object.Method):
- INDEX = 0x00280015 # 40, 21; 2621461
- NAME = 'Exchange.DeleteOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Bind(amqp_object.Method):
- INDEX = 0x0028001E # 40, 30; 2621470
- NAME = 'Exchange.Bind'
- def __init__(self, ticket=0, destination=None, source=None, routing_key='', nowait=False, arguments=None):
- self.ticket = ticket
- self.destination = destination
- self.source = source
- self.routing_key = routing_key
- self.nowait = nowait
- self.arguments = arguments
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.destination, offset = data.decode_short_string(encoded, offset)
- self.source, offset = data.decode_short_string(encoded, offset)
- self.routing_key, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.nowait = (bit_buffer & (1 << 0)) != 0
- (self.arguments, offset) = data.decode_table(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- assert isinstance(self.destination, str_or_bytes),\
- 'A non-string value was supplied for self.destination'
- data.encode_short_string(pieces, self.destination)
- assert isinstance(self.source, str_or_bytes),\
- 'A non-string value was supplied for self.source'
- data.encode_short_string(pieces, self.source)
- assert isinstance(self.routing_key, str_or_bytes),\
- 'A non-string value was supplied for self.routing_key'
- data.encode_short_string(pieces, self.routing_key)
- bit_buffer = 0
- if self.nowait:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- data.encode_table(pieces, self.arguments)
- return pieces
- class BindOk(amqp_object.Method):
- INDEX = 0x0028001F # 40, 31; 2621471
- NAME = 'Exchange.BindOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Unbind(amqp_object.Method):
- INDEX = 0x00280028 # 40, 40; 2621480
- NAME = 'Exchange.Unbind'
- def __init__(self, ticket=0, destination=None, source=None, routing_key='', nowait=False, arguments=None):
- self.ticket = ticket
- self.destination = destination
- self.source = source
- self.routing_key = routing_key
- self.nowait = nowait
- self.arguments = arguments
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.destination, offset = data.decode_short_string(encoded, offset)
- self.source, offset = data.decode_short_string(encoded, offset)
- self.routing_key, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.nowait = (bit_buffer & (1 << 0)) != 0
- (self.arguments, offset) = data.decode_table(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- assert isinstance(self.destination, str_or_bytes),\
- 'A non-string value was supplied for self.destination'
- data.encode_short_string(pieces, self.destination)
- assert isinstance(self.source, str_or_bytes),\
- 'A non-string value was supplied for self.source'
- data.encode_short_string(pieces, self.source)
- assert isinstance(self.routing_key, str_or_bytes),\
- 'A non-string value was supplied for self.routing_key'
- data.encode_short_string(pieces, self.routing_key)
- bit_buffer = 0
- if self.nowait:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- data.encode_table(pieces, self.arguments)
- return pieces
- class UnbindOk(amqp_object.Method):
- INDEX = 0x00280033 # 40, 51; 2621491
- NAME = 'Exchange.UnbindOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Queue(amqp_object.Class):
- INDEX = 0x0032 # 50
- NAME = 'Queue'
- class Declare(amqp_object.Method):
- INDEX = 0x0032000A # 50, 10; 3276810
- NAME = 'Queue.Declare'
- def __init__(self, ticket=0, queue='', passive=False, durable=False, exclusive=False, auto_delete=False, nowait=False, arguments=None):
- self.ticket = ticket
- self.queue = queue
- self.passive = passive
- self.durable = durable
- self.exclusive = exclusive
- self.auto_delete = auto_delete
- self.nowait = nowait
- self.arguments = arguments
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.queue, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.passive = (bit_buffer & (1 << 0)) != 0
- self.durable = (bit_buffer & (1 << 1)) != 0
- self.exclusive = (bit_buffer & (1 << 2)) != 0
- self.auto_delete = (bit_buffer & (1 << 3)) != 0
- self.nowait = (bit_buffer & (1 << 4)) != 0
- (self.arguments, offset) = data.decode_table(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- assert isinstance(self.queue, str_or_bytes),\
- 'A non-string value was supplied for self.queue'
- data.encode_short_string(pieces, self.queue)
- bit_buffer = 0
- if self.passive:
- bit_buffer |= 1 << 0
- if self.durable:
- bit_buffer |= 1 << 1
- if self.exclusive:
- bit_buffer |= 1 << 2
- if self.auto_delete:
- bit_buffer |= 1 << 3
- if self.nowait:
- bit_buffer |= 1 << 4
- pieces.append(struct.pack('B', bit_buffer))
- data.encode_table(pieces, self.arguments)
- return pieces
- class DeclareOk(amqp_object.Method):
- INDEX = 0x0032000B # 50, 11; 3276811
- NAME = 'Queue.DeclareOk'
- def __init__(self, queue=None, message_count=None, consumer_count=None):
- self.queue = queue
- self.message_count = message_count
- self.consumer_count = consumer_count
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.queue, offset = data.decode_short_string(encoded, offset)
- self.message_count = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- self.consumer_count = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.queue, str_or_bytes),\
- 'A non-string value was supplied for self.queue'
- data.encode_short_string(pieces, self.queue)
- pieces.append(struct.pack('>I', self.message_count))
- pieces.append(struct.pack('>I', self.consumer_count))
- return pieces
- class Bind(amqp_object.Method):
- INDEX = 0x00320014 # 50, 20; 3276820
- NAME = 'Queue.Bind'
- def __init__(self, ticket=0, queue='', exchange=None, routing_key='', nowait=False, arguments=None):
- self.ticket = ticket
- self.queue = queue
- self.exchange = exchange
- self.routing_key = routing_key
- self.nowait = nowait
- self.arguments = arguments
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.queue, offset = data.decode_short_string(encoded, offset)
- self.exchange, offset = data.decode_short_string(encoded, offset)
- self.routing_key, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.nowait = (bit_buffer & (1 << 0)) != 0
- (self.arguments, offset) = data.decode_table(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- assert isinstance(self.queue, str_or_bytes),\
- 'A non-string value was supplied for self.queue'
- data.encode_short_string(pieces, self.queue)
- assert isinstance(self.exchange, str_or_bytes),\
- 'A non-string value was supplied for self.exchange'
- data.encode_short_string(pieces, self.exchange)
- assert isinstance(self.routing_key, str_or_bytes),\
- 'A non-string value was supplied for self.routing_key'
- data.encode_short_string(pieces, self.routing_key)
- bit_buffer = 0
- if self.nowait:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- data.encode_table(pieces, self.arguments)
- return pieces
- class BindOk(amqp_object.Method):
- INDEX = 0x00320015 # 50, 21; 3276821
- NAME = 'Queue.BindOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Purge(amqp_object.Method):
- INDEX = 0x0032001E # 50, 30; 3276830
- NAME = 'Queue.Purge'
- def __init__(self, ticket=0, queue='', nowait=False):
- self.ticket = ticket
- self.queue = queue
- self.nowait = nowait
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.queue, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.nowait = (bit_buffer & (1 << 0)) != 0
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- assert isinstance(self.queue, str_or_bytes),\
- 'A non-string value was supplied for self.queue'
- data.encode_short_string(pieces, self.queue)
- bit_buffer = 0
- if self.nowait:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class PurgeOk(amqp_object.Method):
- INDEX = 0x0032001F # 50, 31; 3276831
- NAME = 'Queue.PurgeOk'
- def __init__(self, message_count=None):
- self.message_count = message_count
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.message_count = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>I', self.message_count))
- return pieces
- class Delete(amqp_object.Method):
- INDEX = 0x00320028 # 50, 40; 3276840
- NAME = 'Queue.Delete'
- def __init__(self, ticket=0, queue='', if_unused=False, if_empty=False, nowait=False):
- self.ticket = ticket
- self.queue = queue
- self.if_unused = if_unused
- self.if_empty = if_empty
- self.nowait = nowait
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.queue, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.if_unused = (bit_buffer & (1 << 0)) != 0
- self.if_empty = (bit_buffer & (1 << 1)) != 0
- self.nowait = (bit_buffer & (1 << 2)) != 0
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- assert isinstance(self.queue, str_or_bytes),\
- 'A non-string value was supplied for self.queue'
- data.encode_short_string(pieces, self.queue)
- bit_buffer = 0
- if self.if_unused:
- bit_buffer |= 1 << 0
- if self.if_empty:
- bit_buffer |= 1 << 1
- if self.nowait:
- bit_buffer |= 1 << 2
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class DeleteOk(amqp_object.Method):
- INDEX = 0x00320029 # 50, 41; 3276841
- NAME = 'Queue.DeleteOk'
- def __init__(self, message_count=None):
- self.message_count = message_count
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.message_count = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>I', self.message_count))
- return pieces
- class Unbind(amqp_object.Method):
- INDEX = 0x00320032 # 50, 50; 3276850
- NAME = 'Queue.Unbind'
- def __init__(self, ticket=0, queue='', exchange=None, routing_key='', arguments=None):
- self.ticket = ticket
- self.queue = queue
- self.exchange = exchange
- self.routing_key = routing_key
- self.arguments = arguments
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.queue, offset = data.decode_short_string(encoded, offset)
- self.exchange, offset = data.decode_short_string(encoded, offset)
- self.routing_key, offset = data.decode_short_string(encoded, offset)
- (self.arguments, offset) = data.decode_table(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- assert isinstance(self.queue, str_or_bytes),\
- 'A non-string value was supplied for self.queue'
- data.encode_short_string(pieces, self.queue)
- assert isinstance(self.exchange, str_or_bytes),\
- 'A non-string value was supplied for self.exchange'
- data.encode_short_string(pieces, self.exchange)
- assert isinstance(self.routing_key, str_or_bytes),\
- 'A non-string value was supplied for self.routing_key'
- data.encode_short_string(pieces, self.routing_key)
- data.encode_table(pieces, self.arguments)
- return pieces
- class UnbindOk(amqp_object.Method):
- INDEX = 0x00320033 # 50, 51; 3276851
- NAME = 'Queue.UnbindOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Basic(amqp_object.Class):
- INDEX = 0x003C # 60
- NAME = 'Basic'
- class Qos(amqp_object.Method):
- INDEX = 0x003C000A # 60, 10; 3932170
- NAME = 'Basic.Qos'
- def __init__(self, prefetch_size=0, prefetch_count=0, global_qos=False):
- self.prefetch_size = prefetch_size
- self.prefetch_count = prefetch_count
- self.global_qos = global_qos
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.prefetch_size = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- self.prefetch_count = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.global_qos = (bit_buffer & (1 << 0)) != 0
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>I', self.prefetch_size))
- pieces.append(struct.pack('>H', self.prefetch_count))
- bit_buffer = 0
- if self.global_qos:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class QosOk(amqp_object.Method):
- INDEX = 0x003C000B # 60, 11; 3932171
- NAME = 'Basic.QosOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Consume(amqp_object.Method):
- INDEX = 0x003C0014 # 60, 20; 3932180
- NAME = 'Basic.Consume'
- def __init__(self, ticket=0, queue='', consumer_tag='', no_local=False, no_ack=False, exclusive=False, nowait=False, arguments=None):
- self.ticket = ticket
- self.queue = queue
- self.consumer_tag = consumer_tag
- self.no_local = no_local
- self.no_ack = no_ack
- self.exclusive = exclusive
- self.nowait = nowait
- self.arguments = arguments
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.queue, offset = data.decode_short_string(encoded, offset)
- self.consumer_tag, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.no_local = (bit_buffer & (1 << 0)) != 0
- self.no_ack = (bit_buffer & (1 << 1)) != 0
- self.exclusive = (bit_buffer & (1 << 2)) != 0
- self.nowait = (bit_buffer & (1 << 3)) != 0
- (self.arguments, offset) = data.decode_table(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- assert isinstance(self.queue, str_or_bytes),\
- 'A non-string value was supplied for self.queue'
- data.encode_short_string(pieces, self.queue)
- assert isinstance(self.consumer_tag, str_or_bytes),\
- 'A non-string value was supplied for self.consumer_tag'
- data.encode_short_string(pieces, self.consumer_tag)
- bit_buffer = 0
- if self.no_local:
- bit_buffer |= 1 << 0
- if self.no_ack:
- bit_buffer |= 1 << 1
- if self.exclusive:
- bit_buffer |= 1 << 2
- if self.nowait:
- bit_buffer |= 1 << 3
- pieces.append(struct.pack('B', bit_buffer))
- data.encode_table(pieces, self.arguments)
- return pieces
- class ConsumeOk(amqp_object.Method):
- INDEX = 0x003C0015 # 60, 21; 3932181
- NAME = 'Basic.ConsumeOk'
- def __init__(self, consumer_tag=None):
- self.consumer_tag = consumer_tag
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.consumer_tag, offset = data.decode_short_string(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.consumer_tag, str_or_bytes),\
- 'A non-string value was supplied for self.consumer_tag'
- data.encode_short_string(pieces, self.consumer_tag)
- return pieces
- class Cancel(amqp_object.Method):
- INDEX = 0x003C001E # 60, 30; 3932190
- NAME = 'Basic.Cancel'
- def __init__(self, consumer_tag=None, nowait=False):
- self.consumer_tag = consumer_tag
- self.nowait = nowait
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.consumer_tag, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.nowait = (bit_buffer & (1 << 0)) != 0
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.consumer_tag, str_or_bytes),\
- 'A non-string value was supplied for self.consumer_tag'
- data.encode_short_string(pieces, self.consumer_tag)
- bit_buffer = 0
- if self.nowait:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class CancelOk(amqp_object.Method):
- INDEX = 0x003C001F # 60, 31; 3932191
- NAME = 'Basic.CancelOk'
- def __init__(self, consumer_tag=None):
- self.consumer_tag = consumer_tag
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.consumer_tag, offset = data.decode_short_string(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.consumer_tag, str_or_bytes),\
- 'A non-string value was supplied for self.consumer_tag'
- data.encode_short_string(pieces, self.consumer_tag)
- return pieces
- class Publish(amqp_object.Method):
- INDEX = 0x003C0028 # 60, 40; 3932200
- NAME = 'Basic.Publish'
- def __init__(self, ticket=0, exchange='', routing_key='', mandatory=False, immediate=False):
- self.ticket = ticket
- self.exchange = exchange
- self.routing_key = routing_key
- self.mandatory = mandatory
- self.immediate = immediate
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.exchange, offset = data.decode_short_string(encoded, offset)
- self.routing_key, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.mandatory = (bit_buffer & (1 << 0)) != 0
- self.immediate = (bit_buffer & (1 << 1)) != 0
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- assert isinstance(self.exchange, str_or_bytes),\
- 'A non-string value was supplied for self.exchange'
- data.encode_short_string(pieces, self.exchange)
- assert isinstance(self.routing_key, str_or_bytes),\
- 'A non-string value was supplied for self.routing_key'
- data.encode_short_string(pieces, self.routing_key)
- bit_buffer = 0
- if self.mandatory:
- bit_buffer |= 1 << 0
- if self.immediate:
- bit_buffer |= 1 << 1
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class Return(amqp_object.Method):
- INDEX = 0x003C0032 # 60, 50; 3932210
- NAME = 'Basic.Return'
- def __init__(self, reply_code=None, reply_text='', exchange=None, routing_key=None):
- self.reply_code = reply_code
- self.reply_text = reply_text
- self.exchange = exchange
- self.routing_key = routing_key
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.reply_code = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.reply_text, offset = data.decode_short_string(encoded, offset)
- self.exchange, offset = data.decode_short_string(encoded, offset)
- self.routing_key, offset = data.decode_short_string(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.reply_code))
- assert isinstance(self.reply_text, str_or_bytes),\
- 'A non-string value was supplied for self.reply_text'
- data.encode_short_string(pieces, self.reply_text)
- assert isinstance(self.exchange, str_or_bytes),\
- 'A non-string value was supplied for self.exchange'
- data.encode_short_string(pieces, self.exchange)
- assert isinstance(self.routing_key, str_or_bytes),\
- 'A non-string value was supplied for self.routing_key'
- data.encode_short_string(pieces, self.routing_key)
- return pieces
- class Deliver(amqp_object.Method):
- INDEX = 0x003C003C # 60, 60; 3932220
- NAME = 'Basic.Deliver'
- def __init__(self, consumer_tag=None, delivery_tag=None, redelivered=False, exchange=None, routing_key=None):
- self.consumer_tag = consumer_tag
- self.delivery_tag = delivery_tag
- self.redelivered = redelivered
- self.exchange = exchange
- self.routing_key = routing_key
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.consumer_tag, offset = data.decode_short_string(encoded, offset)
- self.delivery_tag = struct.unpack_from('>Q', encoded, offset)[0]
- offset += 8
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.redelivered = (bit_buffer & (1 << 0)) != 0
- self.exchange, offset = data.decode_short_string(encoded, offset)
- self.routing_key, offset = data.decode_short_string(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.consumer_tag, str_or_bytes),\
- 'A non-string value was supplied for self.consumer_tag'
- data.encode_short_string(pieces, self.consumer_tag)
- pieces.append(struct.pack('>Q', self.delivery_tag))
- bit_buffer = 0
- if self.redelivered:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- assert isinstance(self.exchange, str_or_bytes),\
- 'A non-string value was supplied for self.exchange'
- data.encode_short_string(pieces, self.exchange)
- assert isinstance(self.routing_key, str_or_bytes),\
- 'A non-string value was supplied for self.routing_key'
- data.encode_short_string(pieces, self.routing_key)
- return pieces
- class Get(amqp_object.Method):
- INDEX = 0x003C0046 # 60, 70; 3932230
- NAME = 'Basic.Get'
- def __init__(self, ticket=0, queue='', no_ack=False):
- self.ticket = ticket
- self.queue = queue
- self.no_ack = no_ack
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- self.ticket = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- self.queue, offset = data.decode_short_string(encoded, offset)
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.no_ack = (bit_buffer & (1 << 0)) != 0
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>H', self.ticket))
- assert isinstance(self.queue, str_or_bytes),\
- 'A non-string value was supplied for self.queue'
- data.encode_short_string(pieces, self.queue)
- bit_buffer = 0
- if self.no_ack:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class GetOk(amqp_object.Method):
- INDEX = 0x003C0047 # 60, 71; 3932231
- NAME = 'Basic.GetOk'
- def __init__(self, delivery_tag=None, redelivered=False, exchange=None, routing_key=None, message_count=None):
- self.delivery_tag = delivery_tag
- self.redelivered = redelivered
- self.exchange = exchange
- self.routing_key = routing_key
- self.message_count = message_count
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.delivery_tag = struct.unpack_from('>Q', encoded, offset)[0]
- offset += 8
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.redelivered = (bit_buffer & (1 << 0)) != 0
- self.exchange, offset = data.decode_short_string(encoded, offset)
- self.routing_key, offset = data.decode_short_string(encoded, offset)
- self.message_count = struct.unpack_from('>I', encoded, offset)[0]
- offset += 4
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>Q', self.delivery_tag))
- bit_buffer = 0
- if self.redelivered:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- assert isinstance(self.exchange, str_or_bytes),\
- 'A non-string value was supplied for self.exchange'
- data.encode_short_string(pieces, self.exchange)
- assert isinstance(self.routing_key, str_or_bytes),\
- 'A non-string value was supplied for self.routing_key'
- data.encode_short_string(pieces, self.routing_key)
- pieces.append(struct.pack('>I', self.message_count))
- return pieces
- class GetEmpty(amqp_object.Method):
- INDEX = 0x003C0048 # 60, 72; 3932232
- NAME = 'Basic.GetEmpty'
- def __init__(self, cluster_id=''):
- self.cluster_id = cluster_id
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.cluster_id, offset = data.decode_short_string(encoded, offset)
- return self
- def encode(self):
- pieces = list()
- assert isinstance(self.cluster_id, str_or_bytes),\
- 'A non-string value was supplied for self.cluster_id'
- data.encode_short_string(pieces, self.cluster_id)
- return pieces
- class Ack(amqp_object.Method):
- INDEX = 0x003C0050 # 60, 80; 3932240
- NAME = 'Basic.Ack'
- def __init__(self, delivery_tag=0, multiple=False):
- self.delivery_tag = delivery_tag
- self.multiple = multiple
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.delivery_tag = struct.unpack_from('>Q', encoded, offset)[0]
- offset += 8
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.multiple = (bit_buffer & (1 << 0)) != 0
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>Q', self.delivery_tag))
- bit_buffer = 0
- if self.multiple:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class Reject(amqp_object.Method):
- INDEX = 0x003C005A # 60, 90; 3932250
- NAME = 'Basic.Reject'
- def __init__(self, delivery_tag=None, requeue=True):
- self.delivery_tag = delivery_tag
- self.requeue = requeue
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.delivery_tag = struct.unpack_from('>Q', encoded, offset)[0]
- offset += 8
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.requeue = (bit_buffer & (1 << 0)) != 0
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>Q', self.delivery_tag))
- bit_buffer = 0
- if self.requeue:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class RecoverAsync(amqp_object.Method):
- INDEX = 0x003C0064 # 60, 100; 3932260
- NAME = 'Basic.RecoverAsync'
- def __init__(self, requeue=False):
- self.requeue = requeue
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.requeue = (bit_buffer & (1 << 0)) != 0
- return self
- def encode(self):
- pieces = list()
- bit_buffer = 0
- if self.requeue:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class Recover(amqp_object.Method):
- INDEX = 0x003C006E # 60, 110; 3932270
- NAME = 'Basic.Recover'
- def __init__(self, requeue=False):
- self.requeue = requeue
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.requeue = (bit_buffer & (1 << 0)) != 0
- return self
- def encode(self):
- pieces = list()
- bit_buffer = 0
- if self.requeue:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class RecoverOk(amqp_object.Method):
- INDEX = 0x003C006F # 60, 111; 3932271
- NAME = 'Basic.RecoverOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Nack(amqp_object.Method):
- INDEX = 0x003C0078 # 60, 120; 3932280
- NAME = 'Basic.Nack'
- def __init__(self, delivery_tag=0, multiple=False, requeue=True):
- self.delivery_tag = delivery_tag
- self.multiple = multiple
- self.requeue = requeue
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- self.delivery_tag = struct.unpack_from('>Q', encoded, offset)[0]
- offset += 8
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.multiple = (bit_buffer & (1 << 0)) != 0
- self.requeue = (bit_buffer & (1 << 1)) != 0
- return self
- def encode(self):
- pieces = list()
- pieces.append(struct.pack('>Q', self.delivery_tag))
- bit_buffer = 0
- if self.multiple:
- bit_buffer |= 1 << 0
- if self.requeue:
- bit_buffer |= 1 << 1
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class Tx(amqp_object.Class):
- INDEX = 0x005A # 90
- NAME = 'Tx'
- class Select(amqp_object.Method):
- INDEX = 0x005A000A # 90, 10; 5898250
- NAME = 'Tx.Select'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class SelectOk(amqp_object.Method):
- INDEX = 0x005A000B # 90, 11; 5898251
- NAME = 'Tx.SelectOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Commit(amqp_object.Method):
- INDEX = 0x005A0014 # 90, 20; 5898260
- NAME = 'Tx.Commit'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class CommitOk(amqp_object.Method):
- INDEX = 0x005A0015 # 90, 21; 5898261
- NAME = 'Tx.CommitOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Rollback(amqp_object.Method):
- INDEX = 0x005A001E # 90, 30; 5898270
- NAME = 'Tx.Rollback'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class RollbackOk(amqp_object.Method):
- INDEX = 0x005A001F # 90, 31; 5898271
- NAME = 'Tx.RollbackOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class Confirm(amqp_object.Class):
- INDEX = 0x0055 # 85
- NAME = 'Confirm'
- class Select(amqp_object.Method):
- INDEX = 0x0055000A # 85, 10; 5570570
- NAME = 'Confirm.Select'
- def __init__(self, nowait=False):
- self.nowait = nowait
- @property
- def synchronous(self):
- return True
- def decode(self, encoded, offset=0):
- bit_buffer = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- self.nowait = (bit_buffer & (1 << 0)) != 0
- return self
- def encode(self):
- pieces = list()
- bit_buffer = 0
- if self.nowait:
- bit_buffer |= 1 << 0
- pieces.append(struct.pack('B', bit_buffer))
- return pieces
- class SelectOk(amqp_object.Method):
- INDEX = 0x0055000B # 85, 11; 5570571
- NAME = 'Confirm.SelectOk'
- def __init__(self):
- pass
- @property
- def synchronous(self):
- return False
- def decode(self, encoded, offset=0):
- return self
- def encode(self):
- pieces = list()
- return pieces
- class BasicProperties(amqp_object.Properties):
- CLASS = Basic
- INDEX = 0x003C # 60
- NAME = 'BasicProperties'
- FLAG_CONTENT_TYPE = (1 << 15)
- FLAG_CONTENT_ENCODING = (1 << 14)
- FLAG_HEADERS = (1 << 13)
- FLAG_DELIVERY_MODE = (1 << 12)
- FLAG_PRIORITY = (1 << 11)
- FLAG_CORRELATION_ID = (1 << 10)
- FLAG_REPLY_TO = (1 << 9)
- FLAG_EXPIRATION = (1 << 8)
- FLAG_MESSAGE_ID = (1 << 7)
- FLAG_TIMESTAMP = (1 << 6)
- FLAG_TYPE = (1 << 5)
- FLAG_USER_ID = (1 << 4)
- FLAG_APP_ID = (1 << 3)
- FLAG_CLUSTER_ID = (1 << 2)
- def __init__(self, content_type=None, content_encoding=None, headers=None, delivery_mode=None, priority=None, correlation_id=None, reply_to=None, expiration=None, message_id=None, timestamp=None, type=None, user_id=None, app_id=None, cluster_id=None):
- self.content_type = content_type
- self.content_encoding = content_encoding
- self.headers = headers
- self.delivery_mode = delivery_mode
- self.priority = priority
- self.correlation_id = correlation_id
- self.reply_to = reply_to
- self.expiration = expiration
- self.message_id = message_id
- self.timestamp = timestamp
- self.type = type
- self.user_id = user_id
- self.app_id = app_id
- self.cluster_id = cluster_id
- def decode(self, encoded, offset=0):
- flags = 0
- flagword_index = 0
- while True:
- partial_flags = struct.unpack_from('>H', encoded, offset)[0]
- offset += 2
- flags = flags | (partial_flags << (flagword_index * 16))
- if not (partial_flags & 1):
- break
- flagword_index += 1
- if flags & BasicProperties.FLAG_CONTENT_TYPE:
- self.content_type, offset = data.decode_short_string(encoded, offset)
- else:
- self.content_type = None
- if flags & BasicProperties.FLAG_CONTENT_ENCODING:
- self.content_encoding, offset = data.decode_short_string(encoded, offset)
- else:
- self.content_encoding = None
- if flags & BasicProperties.FLAG_HEADERS:
- (self.headers, offset) = data.decode_table(encoded, offset)
- else:
- self.headers = None
- if flags & BasicProperties.FLAG_DELIVERY_MODE:
- self.delivery_mode = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- else:
- self.delivery_mode = None
- if flags & BasicProperties.FLAG_PRIORITY:
- self.priority = struct.unpack_from('B', encoded, offset)[0]
- offset += 1
- else:
- self.priority = None
- if flags & BasicProperties.FLAG_CORRELATION_ID:
- self.correlation_id, offset = data.decode_short_string(encoded, offset)
- else:
- self.correlation_id = None
- if flags & BasicProperties.FLAG_REPLY_TO:
- self.reply_to, offset = data.decode_short_string(encoded, offset)
- else:
- self.reply_to = None
- if flags & BasicProperties.FLAG_EXPIRATION:
- self.expiration, offset = data.decode_short_string(encoded, offset)
- else:
- self.expiration = None
- if flags & BasicProperties.FLAG_MESSAGE_ID:
- self.message_id, offset = data.decode_short_string(encoded, offset)
- else:
- self.message_id = None
- if flags & BasicProperties.FLAG_TIMESTAMP:
- self.timestamp = struct.unpack_from('>Q', encoded, offset)[0]
- offset += 8
- else:
- self.timestamp = None
- if flags & BasicProperties.FLAG_TYPE:
- self.type, offset = data.decode_short_string(encoded, offset)
- else:
- self.type = None
- if flags & BasicProperties.FLAG_USER_ID:
- self.user_id, offset = data.decode_short_string(encoded, offset)
- else:
- self.user_id = None
- if flags & BasicProperties.FLAG_APP_ID:
- self.app_id, offset = data.decode_short_string(encoded, offset)
- else:
- self.app_id = None
- if flags & BasicProperties.FLAG_CLUSTER_ID:
- self.cluster_id, offset = data.decode_short_string(encoded, offset)
- else:
- self.cluster_id = None
- return self
- def encode(self):
- pieces = list()
- flags = 0
- if self.content_type is not None:
- flags = flags | BasicProperties.FLAG_CONTENT_TYPE
- assert isinstance(self.content_type, str_or_bytes),\
- 'A non-string value was supplied for self.content_type'
- data.encode_short_string(pieces, self.content_type)
- if self.content_encoding is not None:
- flags = flags | BasicProperties.FLAG_CONTENT_ENCODING
- assert isinstance(self.content_encoding, str_or_bytes),\
- 'A non-string value was supplied for self.content_encoding'
- data.encode_short_string(pieces, self.content_encoding)
- if self.headers is not None:
- flags = flags | BasicProperties.FLAG_HEADERS
- data.encode_table(pieces, self.headers)
- if self.delivery_mode is not None:
- flags = flags | BasicProperties.FLAG_DELIVERY_MODE
- pieces.append(struct.pack('B', self.delivery_mode))
- if self.priority is not None:
- flags = flags | BasicProperties.FLAG_PRIORITY
- pieces.append(struct.pack('B', self.priority))
- if self.correlation_id is not None:
- flags = flags | BasicProperties.FLAG_CORRELATION_ID
- assert isinstance(self.correlation_id, str_or_bytes),\
- 'A non-string value was supplied for self.correlation_id'
- data.encode_short_string(pieces, self.correlation_id)
- if self.reply_to is not None:
- flags = flags | BasicProperties.FLAG_REPLY_TO
- assert isinstance(self.reply_to, str_or_bytes),\
- 'A non-string value was supplied for self.reply_to'
- data.encode_short_string(pieces, self.reply_to)
- if self.expiration is not None:
- flags = flags | BasicProperties.FLAG_EXPIRATION
- assert isinstance(self.expiration, str_or_bytes),\
- 'A non-string value was supplied for self.expiration'
- data.encode_short_string(pieces, self.expiration)
- if self.message_id is not None:
- flags = flags | BasicProperties.FLAG_MESSAGE_ID
- assert isinstance(self.message_id, str_or_bytes),\
- 'A non-string value was supplied for self.message_id'
- data.encode_short_string(pieces, self.message_id)
- if self.timestamp is not None:
- flags = flags | BasicProperties.FLAG_TIMESTAMP
- pieces.append(struct.pack('>Q', self.timestamp))
- if self.type is not None:
- flags = flags | BasicProperties.FLAG_TYPE
- assert isinstance(self.type, str_or_bytes),\
- 'A non-string value was supplied for self.type'
- data.encode_short_string(pieces, self.type)
- if self.user_id is not None:
- flags = flags | BasicProperties.FLAG_USER_ID
- assert isinstance(self.user_id, str_or_bytes),\
- 'A non-string value was supplied for self.user_id'
- data.encode_short_string(pieces, self.user_id)
- if self.app_id is not None:
- flags = flags | BasicProperties.FLAG_APP_ID
- assert isinstance(self.app_id, str_or_bytes),\
- 'A non-string value was supplied for self.app_id'
- data.encode_short_string(pieces, self.app_id)
- if self.cluster_id is not None:
- flags = flags | BasicProperties.FLAG_CLUSTER_ID
- assert isinstance(self.cluster_id, str_or_bytes),\
- 'A non-string value was supplied for self.cluster_id'
- data.encode_short_string(pieces, self.cluster_id)
- flag_pieces = list()
- while True:
- remainder = flags >> 16
- partial_flags = flags & 0xFFFE
- if remainder != 0:
- partial_flags |= 1
- flag_pieces.append(struct.pack('>H', partial_flags))
- flags = remainder
- if not flags:
- break
- return flag_pieces + pieces
- methods = {
- 0x000A000A: Connection.Start,
- 0x000A000B: Connection.StartOk,
- 0x000A0014: Connection.Secure,
- 0x000A0015: Connection.SecureOk,
- 0x000A001E: Connection.Tune,
- 0x000A001F: Connection.TuneOk,
- 0x000A0028: Connection.Open,
- 0x000A0029: Connection.OpenOk,
- 0x000A0032: Connection.Close,
- 0x000A0033: Connection.CloseOk,
- 0x000A003C: Connection.Blocked,
- 0x000A003D: Connection.Unblocked,
- 0x0014000A: Channel.Open,
- 0x0014000B: Channel.OpenOk,
- 0x00140014: Channel.Flow,
- 0x00140015: Channel.FlowOk,
- 0x00140028: Channel.Close,
- 0x00140029: Channel.CloseOk,
- 0x001E000A: Access.Request,
- 0x001E000B: Access.RequestOk,
- 0x0028000A: Exchange.Declare,
- 0x0028000B: Exchange.DeclareOk,
- 0x00280014: Exchange.Delete,
- 0x00280015: Exchange.DeleteOk,
- 0x0028001E: Exchange.Bind,
- 0x0028001F: Exchange.BindOk,
- 0x00280028: Exchange.Unbind,
- 0x00280033: Exchange.UnbindOk,
- 0x0032000A: Queue.Declare,
- 0x0032000B: Queue.DeclareOk,
- 0x00320014: Queue.Bind,
- 0x00320015: Queue.BindOk,
- 0x0032001E: Queue.Purge,
- 0x0032001F: Queue.PurgeOk,
- 0x00320028: Queue.Delete,
- 0x00320029: Queue.DeleteOk,
- 0x00320032: Queue.Unbind,
- 0x00320033: Queue.UnbindOk,
- 0x003C000A: Basic.Qos,
- 0x003C000B: Basic.QosOk,
- 0x003C0014: Basic.Consume,
- 0x003C0015: Basic.ConsumeOk,
- 0x003C001E: Basic.Cancel,
- 0x003C001F: Basic.CancelOk,
- 0x003C0028: Basic.Publish,
- 0x003C0032: Basic.Return,
- 0x003C003C: Basic.Deliver,
- 0x003C0046: Basic.Get,
- 0x003C0047: Basic.GetOk,
- 0x003C0048: Basic.GetEmpty,
- 0x003C0050: Basic.Ack,
- 0x003C005A: Basic.Reject,
- 0x003C0064: Basic.RecoverAsync,
- 0x003C006E: Basic.Recover,
- 0x003C006F: Basic.RecoverOk,
- 0x003C0078: Basic.Nack,
- 0x005A000A: Tx.Select,
- 0x005A000B: Tx.SelectOk,
- 0x005A0014: Tx.Commit,
- 0x005A0015: Tx.CommitOk,
- 0x005A001E: Tx.Rollback,
- 0x005A001F: Tx.RollbackOk,
- 0x0055000A: Confirm.Select,
- 0x0055000B: Confirm.SelectOk
- }
- props = {
- 0x003C: BasicProperties
- }
- def has_content(methodNumber):
- return methodNumber in (
- Basic.Publish.INDEX,
- Basic.Return.INDEX,
- Basic.Deliver.INDEX,
- Basic.GetOk.INDEX,
- )
|