incrementNextIncomingId();
if(transfer.getDeliveryId() == null || transfer.getDeliveryId().equals(_currentDeliveryId))
{
TransportReceiver transportReceiver = (TransportReceiver) getLinkFromRemoteHandle(transfer.getHandle());
ReceiverImpl receiver = transportReceiver.getReceiver();
Binary deliveryTag = transfer.getDeliveryTag();
delivery = _unsettledIncomingDeliveriesById.get(_currentDeliveryId);
delivery.getTransportDelivery().incrementSessionSize();
}
else
{
// TODO - check deliveryId has been incremented by one
_currentDeliveryId = transfer.getDeliveryId();
// TODO - check link handle valid and a receiver
TransportReceiver transportReceiver = (TransportReceiver) getLinkFromRemoteHandle(transfer.getHandle());
ReceiverImpl receiver = transportReceiver.getReceiver();
Binary deliveryTag = transfer.getDeliveryTag();
delivery = receiver.delivery(deliveryTag.getArray(), deliveryTag.getArrayOffset(),
deliveryTag.getLength());
TransportDelivery transportDelivery = new TransportDelivery(_currentDeliveryId, delivery, transportReceiver);
delivery.setTransportDelivery(transportDelivery);
_unsettledIncomingDeliveriesById.put(_currentDeliveryId, delivery);
}
if( transfer.getState()!=null )