public UnsignedInteger unsignedIntegerValue() { return UnsignedInteger.valueOf(_seqNo); } }
public UnsignedInteger add(final UnsignedInteger i) { int val = _underlying + i._underlying; return UnsignedInteger.valueOf(val); }
public UnsignedInteger subtract(final UnsignedInteger i) { int val = _underlying - i._underlying; return UnsignedInteger.valueOf(val); }
public static UnsignedInteger valueOf(final long longVal) { if(longVal < 0L || longVal >= (1L<<32)) { throw new NumberFormatException("Value \""+longVal+"\" lies outside the range [" + 0L + "-" + (1L<<32) +")."); } return valueOf((int)longVal); }
public static UnsignedInteger valueOf(final String value) { long longVal = Long.parseLong(value); return valueOf(longVal); }
public UnsignedInteger getNextOutgoingId() { return UnsignedInteger.valueOf(_nextOutgoingId.intValue()); }
@Override public UnsignedInteger construct(final QpidByteBuffer in, final ValueHandler handler) throws AmqpErrorException { if (in.hasRemaining(4)) { final int i = in.getInt(); return UnsignedInteger.valueOf(i); } else { throw new AmqpErrorException(AmqpError.DECODE_ERROR, "Cannot construct uint: insufficient input data"); } } }
if(port > 0) infoMap.put(Symbol.valueOf("port"), UnsignedInteger.valueOf(port));
@Override public UnsignedInteger construct(final QpidByteBuffer in, final ValueHandler handler) throws AmqpErrorException { if (in.hasRemaining()) { byte b = in.get(); return UnsignedInteger.valueOf(((int) b) & 0xff); } else { throw new AmqpErrorException(AmqpError.DECODE_ERROR, "Cannot construct uint: insufficient input data"); } } }
@Override public void start() { setLinkCredit(UnsignedInteger.valueOf(getReceivingDestination().getCredit())); setCreditWindow(); }
public boolean hasCreditToSend() { UnsignedInteger linkCredit = getLinkCredit(); return linkCredit != null && (linkCredit.compareTo(UnsignedInteger.valueOf(0)) > 0) && getSession().hasCreditToSend(); }
public Session_1_0(final AMQPConnection_1_0 connection, Begin begin, int sendingChannelId, int receivingChannelId, long incomingWindow) { super(connection, sendingChannelId); _sendingChannel = sendingChannelId; _sessionState = SessionState.ACTIVE; _nextIncomingId = new SequenceNumber(begin.getNextOutgoingId().intValue()); _connection = connection; _primaryDomain = getPrimaryDomain(); _incomingWindow = UnsignedInteger.valueOf(incomingWindow); AccessController.doPrivileged((new PrivilegedAction<Object>() { @Override public Object run() { _connection.getEventLogger().message(ChannelMessages.CREATE()); return null; } }), _accessControllerContext); }
public void sendFlowConditional() { if(_nextIncomingId != null) { UnsignedInteger clientsCredit = _lastSentIncomingLimit.subtract(UnsignedInteger.valueOf(_nextIncomingId.intValue())); // TODO - we should use a better metric here, and/or manage session credit across the whole connection // send a flow if the window is at least half used up if (_incomingWindow.subtract(clientsCredit).compareTo(clientsCredit) >= 0) { sendFlow(); } } }
public SendingLinkEndpoint(final Session_1_0 session, final LinkImpl<Source, Target> link) { super(session, link); setDeliveryCount(new SequenceNumber(0)); setAvailable(UnsignedInteger.valueOf(0)); setCapabilities(Collections.singletonList(AMQPConnection_1_0.SHARED_SUBSCRIPTIONS)); _asyncAutoCommitTransaction = new AsyncAutoCommitTransaction(getSession().getConnection().getAddressSpace().getMessageStore(), this); }
public void sendFlow(final Flow flow) { if(_nextIncomingId != null) { flow.setNextIncomingId(_nextIncomingId.unsignedIntegerValue()); _lastSentIncomingLimit = _incomingWindow.add(_nextIncomingId.unsignedIntegerValue()); } flow.setIncomingWindow(_incomingWindow); flow.setNextOutgoingId(UnsignedInteger.valueOf(_nextOutgoingId.intValue())); flow.setOutgoingWindow(_outgoingWindow); send(flow); }
private void updateDisposition(final Role role, final UnsignedInteger first, final UnsignedInteger last, final DeliveryState state, final boolean settled) { Disposition disposition = new Disposition(); disposition.setRole(role); disposition.setFirst(first); disposition.setLast(last); disposition.setSettled(settled); disposition.setState(state); if (settled) { final DeliveryRegistry deliveryRegistry = role == Role.RECEIVER ? _incomingDeliveryRegistry : _outgoingDeliveryRegistry; SequenceNumber pos = new SequenceNumber(first.intValue()); SequenceNumber end = new SequenceNumber(last.intValue()); while (pos.compareTo(end) <= 0) { deliveryRegistry.removeDelivery(UnsignedInteger.valueOf(pos.intValue())); pos.incr(); } } send(disposition); }
UnsignedInteger deliveryIdUnsigned = UnsignedInteger.valueOf(deliveryId.intValue()); UnsettledDelivery unsettledDelivery = unsettledDeliveries.getDelivery(deliveryIdUnsigned);
UnsignedInteger deliveryId = UnsignedInteger.valueOf(_nextOutgoingDeliveryId++); xfr.setDeliveryId(deliveryId); if (!settled)