Пример #1
0
  synchronized HashMap getLabels() {
    if (labelsCache == null) {
      labelsCache = new HashMap();
      if (getProperty(pValueLabels).length() > 0) {
        String as[] = TextUtils.split(getProperty(pValueLabels), ",");
        for (int i = 0; i < as.length; i++) {
          String s1 = as[i];
          String s2 = getNameFromIndex(i);
          labelsCache.add(s2, s1.trim());
        }

      } else {
        for (int j = 0; j < maxNumberOfMatches; j++) {
          String s = getNameFromIndex(j);
          labelsCache.add(s, s);
        }
      }
      ArrayList array = getProperties();
      Enumeration enumeration = (Enumeration) array.iterator();
      do {
        if (!enumeration.hasMoreElements()) {
          break;
        }
        StringProperty stringproperty = (StringProperty) enumeration.nextElement();
        if (stringproperty.isThreshold() && stringproperty.getName().indexOf("value") < 0) {
          labelsCache.add(stringproperty.getLabel(), stringproperty.getLabel());
        }
      } while (true);
    }
    return labelsCache;
  }
Пример #2
0
  String saveResultProps(Array array, int i) {
    String s = "";
    HashMap hashmap = new HashMap();
    for (int j = i; j < array.size(); j++) {
      String s1 = (String) array.get(j);
      int l = s1.indexOf('=');
      String s4 = s1.substring(0, l);
      String s5 = s1.substring(l + 1);
      hashmap.add(s4, s5);
    }

    for (int k = 1; k <= nMaxCounters; k++) {
      String s2 = getProperty(PROPERTY_NAME_COUNTER_ID + k);
      if (s2.length() <= 0) {
        break;
      }
      String s3 = (String) hashmap.get(s2);
      if (s3 != null) {
        setProperty(PROPERTY_NAME_COUNTER_VALUE + k, s3);
        if (s.length() > 0) {
          s = s + ", ";
        }
      }
      s =
          s
              + getProperty(PROPERTY_NAME_COUNTER_NAME + k)
              + "="
              + getProperty(PROPERTY_NAME_COUNTER_VALUE + k);
    }

    return s;
  }
Пример #3
0
  /**
   * CAUTION: Decompiled by hand.
   *
   * @param s
   * @return
   * @throws IOException
   */
  private String getCommandFromLocalFile(String s) throws IOException {
    String s1;
    s1 = (String) scriptCommands.get(s);
    if (s1 == null) {
      try {
        s1 =
            FileUtils.readFile(Platform.getUsedDirectoryPath("scripts.remote", "") + "//" + s)
                .toString();
      } catch (FileNotFoundException filenotfoundexception) {

        int i = 0;
        for (; i < 10; i++) {
          try {
            s1 =
                FileUtils.readFile(Platform.getUsedDirectoryPath("scripts.remote", "") + "//" + s)
                    .toString();
            if (s1 == null) {
              continue;
            }
          } catch (FileNotFoundException filenotfoundexception1) {
            try {
              Thread.currentThread();
              Thread.sleep(100L);
            } catch (InterruptedException interruptedexception) {
              interruptedexception.printStackTrace();
            }
          }
        }

        if (i == 10) {
          throw filenotfoundexception;
        }
      }
      scriptCommands.add(s, s1);
    }
    return s1;
  }