Obtains the monitoring result currently available, or null if no data is available.

<p>
If no data is available, a background task to collect data will be started.
178761
public T get(Computer c) {
        if(record==null || !record.data.containsKey(c)) {
            // if we don't have the data, schedule the check now
            triggerUpdate();
            return null;
        }
        return record.data.get(c);
    }
572584
protected void displayResult() {

        if (m_thread.getMatchedResources().isEmpty()) {
            m_resultTable.setVisible(false);
            m_infoIntroLayout.setVisible(false);
            m_infoEmptyResult.setVisible(true);
        } else {
            m_resultTable.setVisible(true);
            m_infoIntroLayout.setVisible(false);
            m_infoEmptyResult.setVisible(false);
        }
        m_resultTable.fillTable(A_CmsUI.getCmsObject(), m_thread.getMatchedResources());
        m_searchForm.removeComponent(m_report);
        m_report = null;
    }
431568
private void checkForAbandonedTask(Tenant tenant, TaskRecord taskRecord, long minsSinceLastActivity) {
        if (minsSinceLastActivity > DEAD_TASK_THRESHOLD_MINS) {
            String taskIdentity = createMapKey(tenant, taskRecord.getTaskID());
            String reason = "No progress reported in " + minsSinceLastActivity + " minutes";
            m_logger.error("Remote task {} has not reported progress in {} minutes; marking as failed",
                           taskIdentity, minsSinceLastActivity);
            taskRecord.setProperty(TaskRecord.PROP_FINISH_TIME, Long.toString(System.currentTimeMillis()));
            taskRecord.setProperty(TaskRecord.PROP_FAIL_REASON, reason);
            taskRecord.setStatus(TaskStatus.FAILED);
            updateTaskStatus(tenant, taskRecord, true);
        }
    }
1204128
public Object getResult(AverageData data) {
        return data.count == 0 ? null : data.total / data.count;
    }
1119372
@Override
    public Future<M> requestData() {
        logger.debug(this + " requestData...");
        try {
            validateInitialization();
            synchronized (syncMonitor) {

                // Check if sync is in process.
                if (syncFuture != null && !syncFuture.isDone()) {

                    // Recover sync task if it was canceled for instance during remote reinitialization.
                    if (syncTask == null || syncTask.isDone()) {
                        syncTask = sync();
                    }
                    return syncFuture;
                } else {
                    // cleanup old sync task
                    if (syncTask != null && !syncTask.isDone()) {
                        syncTask.cancel(true);
                    }
                }

                // Create new sync process
                syncFuture = new CompletableFutureLite();
                syncTask = sync();
                return syncFuture;
            }
        } catch (CouldNotPerformException ex) {
            return FutureProcessor.canceledFuture(new CouldNotPerformException("Could not request data!", ex));
        }
    }
184824
private MonitorInformation getMonitorInformation(L location) {
		final K monitorKey = getLocationKey(location);
		MonitorInformation monitorInformation = monitorInformations.get(monitorKey);
		if (monitorInformation == null) {
			// Not found, let's call delegate
			if (delegate.isMonitored(location)) {
				monitorInformation = new MonitorInformation(true, delegate.getMonitor(location));
			} else {
				monitorInformation = NULL_MONITOR_INFORMATION;
			}
			monitorInformations.put(monitorKey, monitorInformation);
		}
		return monitorInformation;
	}
1212216
@Override
  synchronized boolean processHeartbeat(TaskTrackerStatus trackerStatus,
      boolean initialContact) {
    boolean loggingEnabled = LOG.isDebugEnabled();
    String trackerName = trackerStatus.getTrackerName();
    boolean seenBefore = updateTaskTrackerStatus(trackerName, trackerStatus);
    TaskTracker taskTracker = getTaskTracker(trackerName);
    // update the status of the task tracker. Also updates all aggregate
    // statistics
    if (loggingEnabled) {
      LOG.debug("processing heartbeat for " + trackerName);
      LOG.debug("updating TaskTracker status for " + trackerName);
    }
    if (initialContact) {
      // If it's first contact, then clear out 
      // any state hanging around
      if (seenBefore) {
        lostTaskTracker(taskTracker);
      }
    } else {
      // If not first contact, there should be some record of the tracker
      if (!seenBefore) {
        LOG.warn("Status from unknown Tracker : " + trackerName);
        updateTaskTrackerStatus(trackerName, null);
        return false;
      }
    }

    if (initialContact) {
      if (loggingEnabled) {
        LOG.debug("adding new tracker name = " + trackerName);
      }
      addNewTracker(taskTracker);
    }

    if (loggingEnabled) {
      LOG.debug("updating TaskStatus for " + trackerName);
    }
    // update status of all tasks from heartbeat
    updateTaskStatuses(trackerStatus);

    return true;
  }
855077
private void checkInProgressWork() {
        inProgressWorkQueue.addAll(db().getAllInprogressTasks());
        StatusTrail st = null;        
        while ((st = inProgressWorkQueue.removeFirst()) != null) {
            if (st.getTaskId() == null) {
                 log.info("Found task with null taskId {}.", st);
                 st.setStatus(JobStatus.not_done).setAttemptsDone(0).setGivenUp(0);
                 db().updateStatusTrail(st);
                 log.info("Marked the status as not done to ensure it is resubmitted {}", st);
                 continue;
            }
            switch(druidDriver.pollIndexerTaskStatus(st.getTaskId())) {
                case SUCCESS:
                    newWorkQueue.remove(st);// Make sure.
                    st.setStatus(JobStatus.done);
                    st.setAttemptsDone(st.getAttemptsDone() + 1);// This will also set givenUp.
                    db().updateStatusTrail(st);
                    log.info("Task {} succeeded.", st);                    
                    break;
                case FAILED:
                    newWorkQueue.remove(st);// Make sure.
                    st.setStatus(JobStatus.not_done);
                    st.setAttemptsDone(st.getAttemptsDone() + 1);// This will also set givenUp.
                    db().updateStatusTrail(st);
                    log.info("Task {} failed.", st);
                    break;
                case RUNNING:
                    log.info("Task {} in progress.", st);
                    break;
                case UNKNOWN:
                    log.info("Task {} status unknown.", st);
                    break;
            }            
        }
    }
84682
private void checkDone() {
    if (doneHandler != null) {
      if (cause != null) {
        doneHandler.handle(new DefaultFutureResult<T>(cause));
      } else {
        if (count == required) {
          doneHandler.handle(new DefaultFutureResult<T>((T) null));
        }
      }
    }
  }
644947
public synchronized void waitForData() {
        while (this.flushers.isEmpty() && this.isNotStopped()) {
            try {
                this.wait();
            } catch (final InterruptedException e) {
                Thread.currentThread().interrupt();
                throw new RuntimeException(e);
            }
        }
    }
1247387
synchronized public TaskTrackerStatus getTaskTrackerStatus(String trackerID) {
    TaskTracker taskTracker;
    synchronized (taskTrackers) {
      taskTracker = taskTrackers.get(trackerID);
    }
    return (taskTracker == null) ? null : taskTracker.getStatus();
  }
531917
public Status getStatus() {
        String status = m_resultFields.get(STATUS);
        if (status == null) {
            return Status.OK;
        } else {
            return Status.valueOf(status.toUpperCase());
        }
    }
419187
public CheckResponse getRawCheckResponse() {
        if (!checkCalled) {
            setupMaxTries();
            setupWaitTime();

            addResultsToValuesForCheck(getCurrentRowValues());
            long startTime = currentTimeMillis();
            try {
                executeCheckWithRetry();
            } finally {
                checkTime = currentTimeMillis() - startTime;
            }
        }
        return checkResponse;
    }
447990
protected String getResult() {
        // Until read end
        while (!isDone) {
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

        // Get return value
        if (mResult.length() == 0)
            return null;
        else
            return mResult.toString();
    }
1038701
@Override
    public StatusResult get(@Nonnull Run<?, ?> run, @Nonnull TaskListener listener)
            throws IOException, InterruptedException {

        for (ConditionalResult conditionalResult : getResults()) {
            if (conditionalResult.matches(run)) {
                return new StatusResult(
                        defaultIfNull(EnumUtils.getEnum(GHCommitState.class, conditionalResult.getState()), ERROR),
                        new ExpandableMessage(conditionalResult.getMessage()).expandAll(run, listener)
                );
            }
        }

        return new StatusResult(
                PENDING,
                new ExpandableMessage("Can't define which status to set").expandAll(run, listener)
        );
    }
1308940
synchronized void get_monitor() throws DevFailed {
	boolean interupted;
	Util.out4.println("In get_monitor(), used = " + used);

	final boolean owner_thread = false;
	/*
	 * if ((locking_thread != NULL) && (omni_thread::self() ==
	 * locking_thread)) { owner_thread = true;
	 * Util.out4.println("owner_thread !!"); }
	 */

	while (used == true && owner_thread == false) {
	    Util.out4.println("waiting !!");
	    interupted = wait_it(_timeout);

	    if (used == true && interupted == false) {
		Util.out4.println("TIME OUT for thread ");
		Except.throw_exception("API_CommandTimedOut", "Not able to acquire device monitor",
			"TangoMonitor.get_monitor");
	    }
	}
	locked_ctr++;
	if (!owner_thread) {
	    // locking_thread = omni_thread::self();
	    used = true;
	}
    }
752207
@Override
    public void onNewFolder(@NonNull String name) {
        AsyncTask<String, Void, FtpFile> task = new AsyncTask<String, Void, FtpFile>() {

            @Override
            protected FtpFile doInBackground(String... names) {
                FtpFile result = null;
                if (names.length > 0) {
                    result = onNewFolderAsync(names[0]);
                }
                return result;
            }

            @Override
            protected void onPostExecute(FtpFile folder) {
                if (folder != null) {
                    refresh(folder);
                } else {
                    Toast.makeText(getContext(), R.string.nnf_create_folder_error, Toast.LENGTH_SHORT).show();
                }
            }
        };
        task.execute(name);
    }