Esempio n. 1
0
  public FinalResultEntryPerDef processQueryAndfindResults(int givenTimeoutPeriod) {
    // TODO: ultimately this should be fixed with inheritence or an interface (new)
    if (UserNode.getUserNode() == null) return null;

    QueryProcessor qp = new QueryProcessor(this, givenTimeoutPeriod);
    FinalResultEntryPerDef results = qp.analyzeAndFindResults();
    return results;
  }
Esempio n. 2
0
 /**
  * Does not send any queries. Just returns the "translation" of the query definition to a hashmap
  * of candidate gateways and unique smart devices of theirs (duplicates have been eliminated),
  * that will be possibly sent a query. However, it is not certain that all of these smart devices
  * will be sent a query, because some of them will be eliminated later on, if they don't support
  * the requested capability. For a list of motes who are really-finally queried, you can check the
  * FinalResultEntryPerDef object. This list is used for purposes of showing the translation of the
  * query definition to smart devices.
  */
 public HashMap<Gateway, Vector<SmartNode>> processQueryAndOnlyGetAnalysedCandidateHM() {
   // TODO: ultimately this should be fixed with inheritence or an interface (new)
   if (UserNode.getUserNode() == null) return null;
   QueryProcessor qp =
       new QueryProcessor(
           this,
           -1); // timeoutperiod is irrelevant and set to a dummy value! No queries will be sent!
   HashMap<Gateway, Vector<SmartNode>> resultHM = qp.getGatewayToMotesForWhichQueryWillBeSentHM();
   return resultHM;
 }