@Override
    public void run() {
      try {
        ReservationStatus currentStatus = null;

        // No need to retrieve status when there is no reservationId
        while (numberOfTries < maxPollingTries && reservation.getReservationId() != null) {

          // Get the latest version of the reservation..
          Reservation reservationFresh = reservationService.find(reservation.getId());

          logger.debug(
              "Checking status update for: '{}' (try {})",
              reservation.getReservationId(),
              numberOfTries);

          currentStatus = reservationService.getStatus(reservationFresh);
          logger.debug("Got back status {}", currentStatus);

          if (!currentStatus.equals(startStatus)) {
            logger.info(
                "Status change detected {} -> {} for reservation {}",
                new Object[] {startStatus, currentStatus, reservationFresh.getReservationId()});

            reservationFresh = reservationService.updateStatus(reservationFresh, currentStatus);

            Optional<NsiRequestDetails> requestDetails;
            if (reservationFresh.getConnection().isPresent()) {
              requestDetails =
                  Optional.fromNullable(
                      reservationFresh.getConnection().get().getProvisionRequestDetails());
            } else {
              requestDetails = Optional.absent();
            }

            reservationEventPublisher.notifyListeners(
                new ReservationStatusChangeEvent(startStatus, reservationFresh, requestDetails));

            return;
          }

          numberOfTries++;
          Uninterruptibles.sleepUninterruptibly(pollingIntervalInMillis, TimeUnit.MILLISECONDS);
        }
      } catch (Exception e) {
        logger.error(
            "The poller failed for reservation "
                + reservation.getId()
                + "/"
                + reservation.getReservationId(),
            e);
        emailSender.sendErrorMail(e);
      }
    }
  public ReservationView(
      Reservation reservation,
      ElementActionView deleteActionView,
      ElementActionView modifyActionView,
      ElementActionView copyActionView) {
    this.id = reservation.getId();
    this.virtualResourceGroup =
        reservation.getVirtualResourceGroup().map(g -> g.getName()).orElse("-");
    this.sourcePort = new PortView(reservation.getSourcePort());
    this.destinationPort = new PortView(reservation.getDestinationPort());
    // `<c:out>` strips newlines, so we have to manually HTML escape.
    this.failedReason = HtmlUtils.htmlEscape(reservation.formattedFailedReason(), "UTF-8");
    this.cancelReason = HtmlUtils.htmlEscape(reservation.getCancelReason(), "UTF-8");
    this.startDateTime = reservation.getStartDateTime();
    this.endDateTime = reservation.getEndDateTime().orElse(null);
    this.bandwidth = reservation.getBandwidth();
    this.userCreated = reservation.getUserCreated();
    this.providerConnectionId = reservation.getProviderConnectionId();
    this.creationDateTime = reservation.getCreationDateTime();
    this.protectionType = reservation.getRequesterConnection().getProtectionType();
    this.name = reservation.getName();
    NsiRequesterConnection connection = reservation.getRequesterConnection();
    this.requesterConnectionId = connection.getConnectionId();
    this.ero = presentEro(connection);

    states = connection.getStates().toShortString();
    reservationState = connection.getReservationState();
    provisionState = connection.getProvisionState().orElse(null);
    lifecycleState = connection.getLifecycleState();
    dataPlaneActive = connection.isDataPlaneActive();

    this.deleteActionView = deleteActionView;
    this.modifyActionView = modifyActionView;
    this.copyActionView = copyActionView;
  }