Refine search
@Override public void setDeliveryCount(long deliveryCount) { if (_header == null) { if (deliveryCount == 0l) { return; } _header = new Header(); } _header.setDeliveryCount(UnsignedInteger.valueOf(deliveryCount)); }
@Override public int getGroupSequence() { if (properties != null) { UnsignedInteger groupSeqUint = properties.getGroupSequence(); if (groupSeqUint != null) { // This wraps it into the negative int range if uint is over 2^31-1 return groupSeqUint.intValue(); } } return 0; }
private void verifyNewDeliveryIdSequence(UnsignedInteger previousId, UnsignedInteger linkIncomingId, UnsignedInteger newDeliveryId) { if(newDeliveryId == null) { throw new IllegalStateException("No delivery-id specified on first Transfer of new delivery"); } // Doing a primitive comparison, uses intValue() since its a uint sequence // and we need the primitive values to wrap appropriately during comparison. if(previousId != null && previousId.intValue() + 1 != newDeliveryId.intValue()) { throw new IllegalStateException("Expected delivery-id " + previousId.add(UnsignedInteger.ONE) + ", got " + newDeliveryId); } if(linkIncomingId != null) { throw new IllegalStateException("Illegal multiplex of deliveries on same link with delivery-id " + linkIncomingId + " and " + newDeliveryId); } }
private static ServerJMSMessage processProperties(ServerJMSMessage jms, Properties properties) throws Exception { if (properties != null) { if (properties.getMessageId() != null) { jms.setJMSMessageID(AMQPMessageIdHelper.INSTANCE.toMessageIdString(properties.getMessageId())); Binary userId = properties.getUserId(); if (userId != null) { jms.setStringProperty("JMSXUserID", new String(userId.getArray(), userId.getArrayOffset(), userId.getLength(), StandardCharsets.UTF_8)); if (properties.getTo() != null) { if (properties.getGroupSequence() != null) { jms.setIntProperty("JMSXGroupSeq", properties.getGroupSequence().intValue()); if (properties.getReplyToGroupId() != null) {
assertNotNull("Properties section not present", properties); assertEquals("expected to value to be present", testToAddress, properties.getTo()); assertEquals("expected reply to value to be present", testReplyToAddress, properties.getReplyTo()); assertEquals("expected message id value to be present", testMessageId, properties.getMessageId()); assertEquals("expected correlation id value to be present", testCorrelationId, properties.getCorrelationId()); assertEquals("expected subject value to be present", testSubject, properties.getSubject()); assertEquals("expected group id value to be present", testGroupId, properties.getGroupId()); assertEquals("expected group sequence value to be present", UnsignedInteger.valueOf(testGroupSeq), properties.getGroupSequence()); assertEquals("expected reply to group id value to be present", testReplyToGroupId, properties.getReplyToGroupId()); properties.getAbsoluteExpiryTime().getTime()); assertEquals("expected user id value to be present", new Binary(testUserId.getBytes(StandardCharsets.UTF_8)), properties.getUserId());
if(transfer.getDeliveryId() == null || transfer.getDeliveryId().equals(_incomingDeliveryId)) ReceiverImpl receiver = transportReceiver.getReceiver(); Binary deliveryTag = transfer.getDeliveryTag(); delivery = receiver.delivery(deliveryTag.getArray(), deliveryTag.getArrayOffset(), deliveryTag.getLength()); UnsignedInteger messageFormat = transfer.getMessageFormat(); if(messageFormat != null) { delivery.setMessageFormat(messageFormat.intValue()); _incomingWindowSize = _incomingWindowSize.subtract(UnsignedInteger.ONE); if (_incomingWindowSize.equals(UnsignedInteger.ZERO)) { delivery.getLink().modified(false);
byte encodedData[] = encodedMessage.getArray(); int encodedSize = encodedMessage.getLength(); amqp.setHeader(new Header()); amqp.getHeader().setDeliveryCount(new UnsignedInteger(count));
@SuppressWarnings("unchecked") public static ICoreMessage toCore(AMQPMessage message, CoreMessageObjectPools coreMessageObjectPools, Header header, MessageAnnotations annotations, Properties properties, ApplicationProperties applicationProperties, Section body, Footer footer) throws Exception { final long messageId = message.getMessageID(); final Symbol contentType = properties != null ? properties.getContentType() : null; final String contentTypeString = contentType != null ? contentType.toString() : null; result = createObjectMessage(messageId, payload.getArray(), payload.getArrayOffset(), payload.getLength(), coreMessageObjectPools); } else if (isContentType(OCTET_STREAM_CONTENT_TYPE, contentType)) { result = createBytesMessage(messageId, payload.getArray(), payload.getArrayOffset(), payload.getLength(), coreMessageObjectPools); if (header.getTtl() != null) { ttl = header.getTtl().longValue();
HashMap requestBodyMap = new HashMap(); requestBodyMap.put(ClientConstants.REQUEST_RESPONSE_SEQUENCE_NUMBERS, sequenceNumbers); requestBodyMap.put(ClientConstants.REQUEST_RESPONSE_RECEIVER_SETTLE_MODE, UnsignedInteger.valueOf(this.settleModePair.getReceiverSettleMode() == ReceiverSettleMode.FIRST ? 0 : 1)); if(this.isSessionReceiver) receivedMessage.decode(messagePayLoad.getArray(), messagePayLoad.getArrayOffset(), messagePayLoad.getLength()); UUID lockToken = ClientConstants.ZEROLOCKTOKEN; if(((Map)message).containsKey(ClientConstants.REQUEST_RESPONSE_LOCKTOKEN))
@Override public void setGroupSequence(long groupSequence) { if(_properties == null) { if(groupSequence == 0l) { return; } else { _properties = new Properties(); } } _properties.setGroupSequence(UnsignedInteger.valueOf((int) groupSequence)); }
AmqpMessage message = new AmqpMessage(); message.setMessageId("MessageID:" + 0); message.getWrappedMessage().setHeader(new Header()); message.getWrappedMessage().getHeader().setDeliveryCount(new UnsignedInteger(2)); sender.send(message); } finally {
@Override public long getDeliveryCount() { return (_header == null || _header.getDeliveryCount() == null) ? 0l : _header.getDeliveryCount().longValue(); }
public UnsignedInteger add(final UnsignedInteger i) { int val = _underlying + i._underlying; return UnsignedInteger.valueOf(val); }
@Override public void setGroupSequence(int groupSequence) { // This wraps it into the upper uint range if a negative was provided if (groupSequence != 0) { lazyCreateProperties(); properties.setGroupSequence(UnsignedInteger.valueOf(groupSequence)); } else { if (properties != null) { properties.setGroupSequence(null); } } }
open.setMaxFrameSize(UnsignedInteger.valueOf(_maxFrameSize)); open.setIdleTimeOut(new UnsignedInteger(_localIdleTimeout / 2));
@Override public double doubleValue() { return (double) longValue(); }