コード例 #1
0
 def wrapList(self, input):
     if input is None:
         raise ValueError('Wrapper cannot wrap null list')
     list = TLVList(None, None)
     for obj in input:
         list.addElement(self.wrap(obj))
     return list
コード例 #2
0
    def toArgumentsList(self):
        list = TLVList(None,None)
        if self.error is not None and isinstance(self.error, AMQPError):
            list.addElement(0, self.error.toArgumentsList())

        constructor = DescribedConstructor(list.getCode(),TLVFixed(AMQPType.SMALL_ULONG, 0x25))
        list.setConstructor(constructor)
        return list
    def toArgumentsList(self):
        list = TLVList(None, None)

        if self.challenge == None:
            raise ValueError("SASL-Challenge header's challenge can't be null")
        list.addElement(0, AMQPWrapper.wrap(self.challenge))

        constructor = DescribedConstructor(
            list.getCode(), TLVFixed(AMQPType.SMALL_ULONG, 0x42))
        list.setConstructor(constructor)
        return list
    def toArgumentsList(self):
        list = TLVList(None, None)

        if self.mechanisms == None:
            raise ValueError("At least one SASL Mechanism must be specified")
        wrapper = AMQPWrapper()
        list.addElement(0, wrapper.wrapArray(self.mechanisms))
        constructor = DescribedConstructor(
            list.getCode(), TLVFixed(AMQPType.SMALL_ULONG, 0x40))
        list.setConstructor(constructor)
        return list
コード例 #5
0
    def toArgumentsList(self):
        list = TLVList(None, None)

        if self.outcomeCode == None and isinstance(self.outcomeCode,
                                                   OutcomeCode):
            raise ValueError("SASL-Outcome header's code can't be null")
        list.addElement(0, AMQPWrapper.wrap(self.outcomeCode.value))

        if self.additionalData is not None:
            list.addElement(1, AMQPWrapper.wrap(self.additionalData))

        constructor = DescribedConstructor(
            list.getCode(), TLVFixed(AMQPType.SMALL_ULONG, 0x44))
        list.setConstructor(constructor)
        return list
コード例 #6
0
    def toArgumentsList(self):
        list = TLVList(None,None)
        wrapper = AMQPWrapper()
        if self.mechanism == None:
            raise ValueError("SASL-Init header's mechanism can't be null")
        list.addElement(0,wrapper.wrap(self.mechanism))
        if self.initialRespone is not None:
            list.addElement(1,wrapper.wrap(self.initialRespone))
        if self.hostName is not None:
            list.addElement(2, wrapper.wrap(self.hostName))

        constructor = DescribedConstructor(list.getCode(), TLVFixed(AMQPType.SMALL_ULONG, 0x41))
        list.setConstructor(constructor)
        return list
コード例 #7
0
    def toArgumentsList(self):
        list = TLVList(None, None)
        wrapper = AMQPWrapper()
        if self.handle is None:
            raise ValueError("Detach header's handle can't be null")
        list.addElement(0, wrapper.wrap(self.handle))
        if self.closed is not None:
            list.addElement(1, wrapper.wrap(self.closed))
        if self.error is not None and isinstance(self.error, AMQPError):
            list.addElement(2, self.error.toArgumentsList())

        constructor = DescribedConstructor(
            list.getCode(), TLVFixed(AMQPType.SMALL_ULONG, self.code.value))
        list.setConstructor(constructor)
        return list
コード例 #8
0
    def toArgumentsList(self):
        list = TLVList(None, None)
        wrapper = AMQPWrapper()

        if self.name is None:
            raise ValueError("Attach header's name can't be null")
        list.addElement(0, wrapper.wrapString(self.name))

        if self.handle is None:
            raise ValueError("Attach header's handle can't be null")
        list.addElement(1, wrapper.wrap(self.handle))

        if self.role is None:
            raise ValueError("Attach header's role can't be null")

        list.addElement(2, wrapper.wrap(self.role.value))
        if self.sndSettleMode is not None:
            list.addElement(3, wrapper.wrap(self.sndSettleMode))
        if self.rcvSettleMode is not None:
            list.addElement(4, wrapper.wrap(self.rcvSettleMode))
        if self.source is not None and isinstance(self.source, AMQPSource):
            list.addElement(5, self.source.toArgumentsList())
        if self.target is not None and isinstance(self.target, AMQPTarget):
            list.addElement(6, self.target.toArgumentsList())
        if self.unsettled is not None and len(self.unsettled) > 0:
            list.addElement(7, wrapper.wrapMap(self.unsettled))
        if self.incompleteUnsettled is not None:
            list.addElement(8, wrapper.wrap(self.incompleteUnsettled))

        if self.initialDeliveryCount is not None:
            list.addElement(9, wrapper.wrap(self.initialDeliveryCount))
        elif self.role == RoleCode.SENDER:
            raise ValueError(
                "Sender's attach header must contain a non-null initial-delivery-count value"
            )

        if self.maxMessageSize is not None:
            list.addElement(10, wrapper.wrap(self.maxMessageSize))
        if self.offeredCapabilities is not None and len(
                self.offeredCapabilities) > 0:
            list.addElement(11, wrapper.wrapArray(self.offeredCapabilities))
        if self.desiredCapabilities is not None and len(
                self.desiredCapabilities) > 0:
            list.addElement(12, wrapper.wrapArray(self.desiredCapabilities))
        if self.properties is not None and len(self.properties) > 0:
            list.addElement(13, wrapper.wrapMap(self.properties))

        constructor = DescribedConstructor(
            list.getCode(), TLVFixed(AMQPType.SMALL_ULONG, self.code.value))
        list.setConstructor(constructor)
        return list
コード例 #9
0
    def toArgumentsList(self):
        list = TLVList(None, None)
        wrapper = AMQPWrapper()
        if self.handle == None:
            raise ValueError("Transfer header's handle can't be null")
        list.addElement(0, wrapper.wrap(self.handle))
        if self.deliveryId is not None:
            list.addElement(1, wrapper.wrap(self.deliveryId))
        if self.deliveryTag is not None:
            list.addElement(2, wrapper.wrap(self.deliveryTag))
        if self.messageFormat is not None and isinstance(
                self.messageFormat, AMQPMessageFormat):
            list.addElement(3, wrapper.wrap(self.messageFormat.encode()))
        if self.settled is not None:
            list.addElement(4, wrapper.wrap(self.settled))
        if self.more is not None:
            list.addElement(5, wrapper.wrap(self.more))
        if self.rcvSettleMode is not None and isinstance(
                self.rcvSettleMode, ReceiveCode):
            list.addElement(6, wrapper.wrap(self.rcvSettleMode.value))
        if self.state is not None and isinstance(self.state, AMQPState):
            list.addElement(7, wrapper.wrap(self.state.toArgumentsList()))
        if self.resume is not None:
            list.addElement(8, wrapper.wrap(self.resume))
        if self.aborted is not None:
            list.addElement(9, wrapper.wrap(self.aborted))
        if self.batchable is not None:
            list.addElement(10, wrapper.wrap(self.batchable))

        constructor = DescribedConstructor(
            list.getCode(), TLVFixed(AMQPType.SMALL_ULONG, self.code.value))
        list.setConstructor(constructor)
        return list
コード例 #10
0
    def toArgumentsList(self):
        list = TLVList(None, None)
        wrapper = AMQPWrapper()
        if self.remoteChannel is not None:
            list.addElement(0, wrapper.wrap(self.remoteChannel))
        if self.nextOutgoingId is None:
            raise ValueError("Begin header's next-outgoing-id can't be null")
        list.addElement(1, wrapper.wrap(self.nextOutgoingId))
        if self.incomingWindow is None:
            raise ValueError("Begin header's incoming-window can't be null")
        list.addElement(2, wrapper.wrap(self.incomingWindow))
        if self.outgoingWindow is None:
            raise ValueError("Begin header's outgoing-window can't be null")
        list.addElement(3, wrapper.wrap(self.outgoingWindow))
        if self.handleMax is not None:
            list.addElement(4, wrapper.wrap(self.handleMax))
        if self.offeredCapabilities is not None and len(
                self.offeredCapabilities) > 0:
            list.addElement(5, wrapper.wrapArray(self.offeredCapabilities))
        if self.desiredCapabilities is not None and len(
                self.desiredCapabilities) > 0:
            list.addElement(6, wrapper.wrapArray(self.desiredCapabilities))
        if self.properties is not None and len(self.properties) > 0:
            list.addElement(7, wrapper.wrapMap(self.properties))

        constructor = DescribedConstructor(
            list.getCode(), TLVFixed(AMQPType.SMALL_ULONG, self.code.value))
        list.setConstructor(constructor)
        return list
コード例 #11
0
    def toArgumentsList(self):
        list = TLVList(None, None)
        wrapper = AMQPWrapper()
        if self.nextIncomingId is not None:
            list.addElement(0, wrapper.wrap(self.nextIncomingId))
        if self.incomingWindow is None:
            raise ValueError("Flow header's incoming-window can't be null")
        list.addElement(1, wrapper.wrap(self.incomingWindow))
        if self.nextOutgoingId is None:
            raise ValueError("Flow header's next-outgoing-id can't be null")
        list.addElement(2, wrapper.wrap(self.nextOutgoingId))
        if self.outgoingWindow is None:
            raise ValueError("Flow header's outgoing-window can't be null")
        list.addElement(3, wrapper.wrap(self.outgoingWindow))
        if self.handle is not None:
            list.addElement(4, wrapper.wrap(self.handle))
        if self.deliveryCount is not None:
            if self.handle is not None:
                list.addElement(5, wrapper.wrap(self.deliveryCount))
            else:
                raise ValueError(
                    "Flow headers delivery-count can't be assigned when handle is not specified"
                )
        if self.linkCredit is not None:
            if self.handle is not None:
                list.addElement(6, wrapper.wrap(self.linkCredit))
            else:
                raise ValueError(
                    "Flow headers link-credit can't be assigned when handle is not specified"
                )
        if self.available is not None:
            if self.handle is not None:
                list.addElement(7, wrapper.wrap(self.available))
            else:
                raise ValueError(
                    "Flow headers available can't be assigned when handle is not specified"
                )
        if self.drain is not None:
            if self.handle is not None:
                list.addElement(8, wrapper.wrap(self.drain))
            else:
                raise ValueError(
                    "Flow headers drain can't be assigned when handle is not specified"
                )
        if self.echo is not None:
            list.addElement(9, wrapper.wrap(self.echo))
        if self.properties is not None and len(self.properties) > 0:
            list.addElement(10, wrapper.wrapMap(self.properties))

        constructor = DescribedConstructor(
            list.getCode(), TLVFixed(AMQPType.SMALL_ULONG, self.code.value))
        list.setConstructor(constructor)
        return list
    def toArgumentsList(self):
        list = TLVList(None, None)
        wrapper = AMQPWrapper()
        if self.role is None:
            raise ValueError("Disposition header's role can't be null")
        if isinstance(self.role, RoleCode):
            list.addElement(0, wrapper.wrap(self.role.value))
        if self.first is None:
            raise ValueError("Disposition header's first can't be null")
        list.addElement(1, wrapper.wrap(self.first))
        if self.last is not None:
            list.addElement(2, wrapper.wrap(self.last))
        if self.settled is not None:
            list.addElement(3, wrapper.wrap(self.settled))
        if self.state is not None:
            if isinstance(self.state, AMQPState):
                list.addElement(4, self.state.toArgumentsList())
        if self.batchable is not None and len(self.outgoingLocales) > 0:
            list.addElement(5, wrapper.wrap(self.batchable))

        constructor = DescribedConstructor(
            list.getCode(), TLVFixed(AMQPType.SMALL_ULONG, self.code.value))
        list.setConstructor(constructor)
        return list
コード例 #13
0
    def toArgumentsList(self):
        list = TLVList(None,None)
        wrapper = AMQPWrapper()
        if self.containerId is None:
            raise ValueError("Detach header's container id can't be null")
        list.addElement(0, wrapper.wrap(self.containerId))
        if self.hostname is not None:
            list.addElement(1, wrapper.wrap(self.hostname))
        if self.maxFrameSize is not None:
            list.addElement(2, wrapper.wrap(self.maxFrameSize))
        if self.channelMax is not None:
            list.addElement(3, wrapper.wrap(self.channelMax))
        if self.idleTimeout is not None:
            list.addElement(4, wrapper.wrap(self.idleTimeout))
        if self.outgoingLocales is not None and len(self.outgoingLocales) > 0:
            list.addElement(5, wrapper.wrapArray(self.outgoingLocales))
        if self.incomingLocales is not None and len(self.incomingLocales) > 0:
            list.addElement(6, wrapper.wrapArray(self.incomingLocales))
        if self.offeredCapabilities is not None and len(self.offeredCapabilities) > 0:
            list.addElement(7, wrapper.wrapArray(self.offeredCapabilities))
        if self.desiredCapabilities is not None and len(self.desiredCapabilities) > 0:
            list.addElement(8, wrapper.wrapArray(self.desiredCapabilities))
        if self.properties is not None and len(self.properties) > 0:
            list.addElement(9, wrapper.wrapMap(self.properties))

        constructor = DescribedConstructor(list.getCode(),TLVFixed(AMQPType.SMALL_ULONG, self.code.value))
        list.setConstructor(constructor)
        #print('AMQPOpen list.values= ' + str(list.values))
        return list