private ItemStatus addItemToProperQueue(ItemInfo itemInfo, Timestamp baseTime) {
    // Always check whether we even want it for this client
    // The loader's profile and the cache profile will always have a negative client_id,
    // which means that we always want to keep it
    if (this.client_id != -1) {
      if (this.userIdGenerator == null) this.initializeUserIdGenerator(this.client_id);
      if (this.userIdGenerator.checkClient(itemInfo.getSellerId()) == false) {
        return (null);
      }
    }

    long remaining = itemInfo.endDate.getTime() - baseTime.getTime();
    ItemStatus new_status = (itemInfo.status != null ? itemInfo.status : ItemStatus.OPEN);
    // Already ended
    if (remaining <= AuctionMarkConstants.ITEM_ALREADY_ENDED) {
      if (itemInfo.numBids > 0 && itemInfo.status != ItemStatus.CLOSED) {
        new_status = ItemStatus.WAITING_FOR_PURCHASE;
      } else {
        new_status = ItemStatus.CLOSED;
      }
    }
    // About to end soon
    else if (remaining < AuctionMarkConstants.ITEM_ENDING_SOON) {
      new_status = ItemStatus.ENDING_SOON;
    }

    if (new_status != itemInfo.status) {
      if (itemInfo.status != null)
        assert (new_status.ordinal() > itemInfo.status.ordinal())
            : "Trying to improperly move "
                + itemInfo
                + " from "
                + itemInfo.status
                + " to "
                + new_status;

      switch (new_status) {
        case OPEN:
          this.addItem(this.items_available, itemInfo);
          break;
        case ENDING_SOON:
          this.items_available.remove(itemInfo);
          this.addItem(this.items_endingSoon, itemInfo);
          break;
        case WAITING_FOR_PURCHASE:
          (itemInfo.status == ItemStatus.OPEN ? this.items_available : this.items_endingSoon)
              .remove(itemInfo);
          this.addItem(this.items_waitingForPurchase, itemInfo);
          break;
        case CLOSED:
          if (itemInfo.status == ItemStatus.OPEN) this.items_available.remove(itemInfo);
          else if (itemInfo.status == ItemStatus.ENDING_SOON)
            this.items_endingSoon.remove(itemInfo);
          else this.items_waitingForPurchase.remove(itemInfo);
          this.addItem(this.items_completed, itemInfo);
          break;
        default:
      } // SWITCH
      itemInfo.status = new_status;
    }

    if (LOG.isTraceEnabled())
      LOG.trace(
          String.format(
              "%s - #%d [%s]", new_status, itemInfo.itemId.encode(), itemInfo.getEndDate()));

    return (new_status);
  }