@Override public Object getDescriptor() { return UnsignedLong.valueOf(0x0000468C00000004L); }
@Override public double doubleValue() { return (double) longValue(); }
public static UnsignedLong valueOf(long underlying) { if((underlying & 0xFFL) == underlying) { return cachedValues[(int)underlying]; } else { return new UnsignedLong(underlying); } }
public void request( final Message message, final OperationResult<Message, Exception> onResponse) { if (message == null) throw new IllegalArgumentException("message cannot be null"); if (message.getMessageId() != null) throw new IllegalArgumentException("message.getMessageId() should be null"); if (message.getReplyTo() != null) throw new IllegalArgumentException("message.getReplyTo() should be null"); message.setMessageId("request" + UnsignedLong.valueOf(this.requestId.incrementAndGet()).toString()); message.setReplyTo(this.replyTo); this.inflightRequests.put(message.getMessageId(), onResponse); sendLink.delivery(UUID.randomUUID().toString().replace("-", StringUtil.EMPTY).getBytes()); final int payloadSize = AmqpUtil.getDataSerializedSize(message) + 512; // need buffer for headers final byte[] bytes = new byte[payloadSize]; final int encodedSize = message.encode(bytes, 0, payloadSize); receiveLink.flow(1); sendLink.send(bytes, 0, encodedSize); sendLink.advance(); }
public int compareTo(UnsignedLong o) { return bigIntegerValue().compareTo(o.bigIntegerValue()); }
static int getMaxMessageSizeFromLink(Link link) { UnsignedLong maxMessageSize = link.getRemoteMaxMessageSize(); if(maxMessageSize != null) { int maxMessageSizeAsInt = maxMessageSize.intValue(); // A value of 0 means no limit. Treating no limit as 1024 KB thus putting a cap on max message size if(maxMessageSizeAsInt > 0) { return maxMessageSizeAsInt; } } // Default if link doesn't have the value return ClientConstants.MAX_MESSAGE_LENGTH_BYTES; } }
public int compareTo(UnsignedLong o) { return bigIntegerValue().compareTo(o.bigIntegerValue()); }
this.maxMessageSize = remoteMaxMessageSize.intValue();
@Override public Object getDescriptor() { return UnsignedLong.valueOf(0x0000468C00000004L); }
public UnsignedLongEncoding getEncoding(final UnsignedLong val) { long l = val.longValue(); return l == 0L ? _zeroUnsignedLongEncoding : (l <= 255L) ? _smallUnsignedLongEncoding : _unsignedLongEncoding; }
public static UnsignedLong valueOf(long underlying) { if((underlying & 0xFFL) == underlying) { return cachedValues[(int)underlying]; } else { return new UnsignedLong(underlying); } }
public int compareTo(UnsignedLong o) { return bigIntegerValue().compareTo(o.bigIntegerValue()); }
@Override public Object getDescriptor() { return UnsignedLong.valueOf(0x0000468C00000003L); }
@Override public float floatValue() { return (float) longValue(); }
public static UnsignedLong valueOf(long underlying) { if((underlying & 0xFFL) == underlying) { return cachedValues[(int)underlying]; } else { return new UnsignedLong(underlying); } }
@Override public String toString() { return String.valueOf(bigIntegerValue()); }
@Override public Object getDescriptor() { return UnsignedLong.valueOf(0x0000468C00000003L); }
public UnsignedLongEncoding getEncoding(final UnsignedLong val) { long l = val.longValue(); return l == 0L ? _zeroUnsignedLongEncoding : (l <= 255L) ? _smallUnsignedLongEncoding : _unsignedLongEncoding; }
/** * Some clients use Unsigned types from org.apache.qpid.proton.amqp * @throws Exception */ @Test(timeout = 60000) public void testUnsignedValues() throws Exception { int sequence = 42; LinkedHashMap<String, Object> map = new LinkedHashMap<>(); map.put("sequence", new UnsignedInteger(sequence)); ServerJMSMapMessage msg = createMapMessage(1, map, null); assertEquals(msg.getInt("sequence"), sequence); map.clear(); map.put("sequence", new UnsignedLong(sequence)); msg = createMapMessage(1, map, null); assertEquals(msg.getLong("sequence"), sequence); map.clear(); map.put("sequence", new UnsignedShort((short)sequence)); msg = createMapMessage(1, map, null); assertEquals(msg.getShort("sequence"), sequence); map.clear(); map.put("sequence", new UnsignedByte((byte) sequence)); msg = createMapMessage(1, map, null); assertEquals(msg.getByte("sequence"), sequence); } }
@Override public String toString() { return String.valueOf(bigIntegerValue()); }