public boolean canDeliverAssuredInOrder(
    long tick,
    long prevTick,
    int priority)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "canDeliverAssuredInOrder",
        new Object[] {
          Long.valueOf(tick),
          Long.valueOf(prevTick),
          Integer.valueOf(priority)});

    boolean canDeliverInOrder = false;

    synchronized (this)
    {
      // Is prevTick unknown?
      if (prevTick == _mp.getCustomProperties().get_unknown_prev_tick())
      {
        // start assuming we can deliver, but if we find Q/U, Q/G or undelivered V/U, then we cannot
        canDeliverInOrder = true;

        long start = _targetStream.getCompletedPrefix() + 1;
        if (start < tick)
        {
          long end = tick - 1;
          _targetStream.setCursor(start);
          TickRange tr2 = null;
          TickRange tr1 = _targetStream.getNext();
          do
          {
            if ((tr1.type == TickRange.Unknown)
              || (tr1.type == TickRange.Requested))
            {
              canDeliverInOrder = false;
              break;
            }
            else if (tr1.type == TickRange.Value)
            {
              AIValueTick valueTick = (AIValueTick) tr1.value;
              boolean delivered = valueTick.isDelivered();
              Reliability currentReliability = valueTick.getMsgReliability();
              boolean isAssured =
                currentReliability.compareTo(Reliability.RELIABLE_PERSISTENT)
                  >= 0;
              boolean samePriority = (valueTick.getMsgPriority() == priority);
              if (isAssured
                && samePriority
                && !delivered) // has it not been delivered?
              {
                canDeliverInOrder = false;
                break;
              }
            }

            tr2 = tr1;
            tr1 = _targetStream.getNext();
          }
          while ((tr1.startstamp <= end) && (tr1 != tr2));
        }

      }
      else // prevTick not unknown
        {
        _targetStream.setCursor(prevTick);
        TickRange prevTickRange = _targetStream.getNext();
        if ((prevTickRange.type == TickRange.Completed)
          || (prevTickRange.type == TickRange.Accepted))
        {
          canDeliverInOrder = true;
        }
        else if (prevTickRange.type == TickRange.Value)
        {
          // Can deliver if the previous tick is a value and it has been delivered
          canDeliverInOrder = ((AIValueTick) prevTickRange.value).isDelivered();
        }
        else // prevTickRange is not L/D, L/A or delivered V/U
          {
          canDeliverInOrder = false;
        }
      }
    } // end synchronized(this)

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(
        tc,
        "canDeliverAssuredInOrder",
        Boolean.valueOf(canDeliverInOrder));

    return canDeliverInOrder;
  }
public boolean canDeliverAssuredInOrder ( long tick , long prevTick , int priority ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "canDeliverAssuredInOrder" , new Object [ ] { Long . valueOf ( tick ) , Long . valueOf ( prevTick ) , Integer . valueOf ( priority ) } ) ; boolean canDeliverInOrder = false ; synchronized ( this ) { if ( prevTick == _mp . getCustomProperties ( ) . get_unknown_prev_tick ( ) ) { canDeliverInOrder = true ; long start = _targetStream . getCompletedPrefix ( ) + 1 ; if ( start < tick ) { long end = tick - 1 ; _targetStream . setCursor ( start ) ; TickRange tr2 = null ; TickRange tr1 = _targetStream . getNext ( ) ; do { if ( ( tr1 . type == TickRange . Unknown ) || ( tr1 . type == TickRange . Requested ) ) { canDeliverInOrder = false ; break ; } else if ( tr1 . type == TickRange . Value ) { AIValueTick valueTick = ( AIValueTick ) tr1 . value ; boolean delivered = valueTick . isDelivered ( ) ; Reliability currentReliability = valueTick . getMsgReliability ( ) ; boolean isAssured = currentReliability . compareTo ( Reliability . RELIABLE_PERSISTENT ) >= 0 ; boolean samePriority = ( valueTick . getMsgPriority ( ) == priority ) ; if ( isAssured && samePriority && ! delivered ) { canDeliverInOrder = false ; break ; } } tr2 = tr1 ; tr1 = _targetStream . getNext ( ) ; } while ( ( tr1 . startstamp <= end ) && ( tr1 != tr2 ) ) ; } } else { _targetStream . setCursor ( prevTick ) ; TickRange prevTickRange = _targetStream . getNext ( ) ; if ( ( prevTickRange . type == TickRange . Completed ) || ( prevTickRange . type == TickRange . Accepted ) ) { canDeliverInOrder = true ; } else if ( prevTickRange . type == TickRange . Value ) { canDeliverInOrder = ( ( AIValueTick ) prevTickRange . value ) . isDelivered ( ) ; } else { canDeliverInOrder = false ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "canDeliverAssuredInOrder" , Boolean . valueOf ( canDeliverInOrder ) ) ; return canDeliverInOrder ; }
Determine whether an assured V/U tick can be delivered in order:
(a) If prevTick is unknown, then the V/U tick can be delivered only if there are no preceding Q/U
and Q/G ticks, and all preceding V/U ticks have been delivered
(b) If prevTick is t, then the V/U tick can be delivered if t is L/D or L/A, or if it's V/U and it
has been delivered

@return Whether or not the V/U tick can be delivered