public synchronized void resetFileTimeStamp(String s) {
   String s1 = (new File(s)).getAbsolutePath();
   Long long1 = (Long) fileNameMap.get(s1);
   if (long1 != null) {
     fileNameMap.remove(s1);
     fileNameMap.put(s1, new Long(0L));
   }
 }
예제 #2
0
  /**
   * CAUTION: Decompiled by hand.
   *
   * @param hashmap
   * @param hashmap1
   * @param flag
   */
  public void initializeValuesTable(HashMap hashmap, HashMap hashmap1, boolean flag) {
    for (HashMapIterator hashmapiterator = hashmap.begin();
        !hashmapiterator.atEnd();
        hashmapiterator.advance()) {
      String s = (String) hashmapiterator.key();
      Object obj = hashmapiterator.value();
      StringProperty stringproperty = getPropertyObject(s);
      if (stringproperty != null) {
        if (!stringproperty.onPlatform(getPlatform())) {
          continue;
        }
        if (flag) {
          hashmap1.remove(stringproperty);
        }
        if (obj instanceof Array) {
          for (Enumeration enumeration = ((Array) obj).elements();
              enumeration.hasMoreElements();
              hashmap1.add(stringproperty, enumeration.nextElement())) ;
        } else {
          hashmap1.add(stringproperty, obj);
        }
        continue;
      }
      if (flag) {
        hashmap1.remove(s);
      }

      if (obj instanceof Array) {
        Enumeration enumeration1 = ((Array) obj).elements();
        while (enumeration1.hasMoreElements()) {
          Object obj1 = enumeration1.nextElement();
          if ((obj1 instanceof String)) {
            hashmap1.add(s, obj1);
          }
        }
      } else if (obj instanceof String) {
        hashmap1.add(s, obj);
      }
    }
  }
예제 #3
0
  void closeConnection() {
    COM.dragonflow.Log.LogManager.log("RunMonitor", "jdbc log, closing database connection");
    if (logStatementCache != null) {
      try {
        logStatementCache.close();
        logStatementCache = null;
      } catch (java.lang.Exception exception) {
        COM.dragonflow.Log.LogManager.log(
            "RunMonitor", "jdbc logger error: closing statement, " + exception);
        COM.dragonflow.Log.LogManager.log(
            "Error", "jdbc logger error: closing statement, " + exception);
      }
    }
    if (linkStatementCache != null) {
      try {
        linkStatementCache.close();
        linkStatementCache = null;
      } catch (java.lang.Exception exception1) {
        COM.dragonflow.Log.LogManager.log(
            "RunMonitor", "jdbc logger error: closing link statement, " + exception1);
        COM.dragonflow.Log.LogManager.log(
            "Error", "jdbc logger error: closing link statement, " + exception1);
      }
    }
    for (Enumeration enumeration = customStatements.keys(); enumeration.hasMoreElements(); ) {
      String s = (String) enumeration.nextElement();
      java.sql.PreparedStatement preparedstatement =
          (java.sql.PreparedStatement) customStatements.get(s);
      try {
        preparedstatement.close();
        customStatements.remove(s);
        COM.dragonflow.Log.LogManager.log("RunMonitor", "jdbc logger, closed " + s);
      } catch (java.lang.Exception exception3) {
        COM.dragonflow.Log.LogManager.log(
            "RunMonitor", "jdbc logger error, closing " + s + ", " + exception3);
        COM.dragonflow.Log.LogManager.log(
            "Error", "jdbc logger error: closing " + s + ", " + exception3);
      }
    }

    if (connection != null) {
      try {
        connection.close();
        connection = null;
      } catch (java.lang.Exception exception2) {
        COM.dragonflow.Log.LogManager.log(
            "RunMonitor", "jdbc logger error: closing, " + exception2);
        COM.dragonflow.Log.LogManager.log("Error", "jdbc logger error: closing, " + exception2);
      }
    }
    COM.dragonflow.Log.LogManager.log("RunMonitor", "jdbc log, closed");
  }
예제 #4
0
  /**
   * CAUTION: Decompiled by hand.
   *
   * @param hashmap
   * @param hashmap1
   * @param i
   * @param j
   */
  static void resolveTemplateReferences(HashMap hashmap, HashMap hashmap1, int i, int j) {
    if (i > j) {
      LogManager.log("Error", "Loop detected in templates.config");
      return;
    }
    for (Enumeration enumeration = hashmap1.values("__template"); enumeration.hasMoreElements(); ) {
      String s = (String) enumeration.nextElement();
      HashMap hashmap2 = (HashMap) hashmap.get(s);
      if (hashmap2 != null) {
        resolveTemplateReferences(hashmap, hashmap2, i + 1, j);
        Enumeration enumeration1 = hashmap2.keys();
        while (enumeration1.hasMoreElements()) {
          String s1 = (String) enumeration1.nextElement();
          if (hashmap1.get(s1) == null) hashmap1.put(s1, hashmap2.get(s1));
        }
      }
    }

    hashmap1.remove("__template");
  }
예제 #5
0
 public void preprocessValuesTable(HashMap hashmap) {
   String s = "_machine";
   String s1 = (String) hashmap.get(s);
   if (s1 != null) {
     StringProperty stringproperty = getPropertyObject(s);
     if (stringproperty != null) {
       String s2 = TextUtils.getValue(hashmap, "__portalServerID");
       String s3 = s1;
       if (s2.length() > 0) {
         s3 = s3 + "@" + s2;
         if (!s3.endsWith(":")) {
           s3 = s3 + ":";
         }
       }
       os = Machine.getOS(s3);
       valuesTable.add(stringproperty, s1);
     }
     hashmap.remove(s);
   }
   super.preprocessValuesTable(hashmap);
 }
예제 #6
0
  public String update(HashMap hashmap, String s) throws SiteViewException {
    String s1 = (String) hashmap.get("_healthTemplateSet");
    String s2 = "";
    String s3 = "";
    int i = Machine.getOS("");
    String s4 = i != 1 ? "Unix" : "NT";
    if (!Platform.isStandardAccount(s)) {
      s2 =
          Platform.getRoot()
              + File.separator
              + "accounts"
              + File.separator
              + s
              + File.separator
              + "templates.health";
      if (!(new File(s2)).exists()) {
        s2 = Platform.getRoot() + File.separator + "templates.health";
      }
      s3 =
          Platform.getRoot()
              + File.separator
              + "accounts"
              + File.separator
              + s
              + File.separator
              + "groups";
      if (!(new File(s3)).exists()) {
        s3 = Platform.getRoot() + File.separator + "groups";
      }
    } else {
      s2 = Platform.getRoot() + File.separator + "templates.health";
      s3 = Platform.getRoot() + File.separator + "groups";
    }
    if (s1 != null && s1.length() > 0) {
      File file = new File(s2);
      String as[] = file.list();
      Array array = null;
      try {
        array = FrameFile.readFromFile(s3 + "/" + "__Health__.mg");
      } catch (IOException ioexception) {
      }
      if (array == null || array.size() == 0) {
        array = createHealthGroup();
        APISiteView.forceConfigurationRefresh();
      }
      Array array1 = null;
      try {
        array1 = FrameFile.readFromFile(s2 + "/" + s4 + s1);
      } catch (IOException ioexception1) {
        String as1[] = {ioexception1.getMessage()};
        throw new SiteViewParameterException(
            SiteViewErrorCodes.ERR_OP_SS_HEALTH_NO_TEMPLATE_FILE, as1);
      }
      if (array != null && array1 != null) {
        HashMap hashmap1 = (HashMap) array.at(0);
        String s5 = (String) hashmap1.get("_nextID");
        for (int j = 1; j < array1.size(); j++) {
          HashMap hashmap2 = (HashMap) array1.at(j);
          HashMap hashmap3 = new HashMap();
          hashmap3.put("_id", s5);
          String s6;
          for (Enumeration enumeration = hashmap2.keys();
              enumeration.hasMoreElements();
              hashmap3.put(s6, hashmap2.get(s6))) {
            s6 = (String) enumeration.nextElement();
          }

          array.add(hashmap3);
          s5 = TextUtils.increment(s5);
        }

        hashmap1.put("_nextID", s5);
        try {
          FrameFile.writeToFile(s3 + "/" + "__Health__.mg", array);
        } catch (IOException ioexception2) {
          String as2[] = {"__Health__.mg", ioexception2.getMessage()};
          throw new SiteViewParameterException(
              SiteViewErrorCodes.ERR_OP_SS_HEALTH_CANNOT_WRITE, as2);
        }
      }
      hashmap.remove("_healthTemplateSet");
      updateMaster(hashmap);
      APIGroup.forceConfigurationRefresh();
      return s1;
    } else {
      hashmap.remove("_healthTemplateSet");
      updateMaster(hashmap);
      APIGroup.forceConfigurationRefresh();
      return "";
    }
  }
  public synchronized boolean execute() {
    try {
      SiteViewGroup siteviewgroup = SiteViewGroup.currentSiteView();
      Array array = new Array();
      Array array1 = new Array();
      Array array2 = new Array();
      Array array3 = siteviewgroup.getGroupFiles();
      Enumeration enumeration = array3.elements();
      File file = null;
      File file1 = null;
      File file2 = null;
      File file3 = null;
      HashSet hashset = new HashSet();
      for (Enumeration enumeration1 = fileNameMap.keys();
          enumeration1.hasMoreElements();
          hashset.add(enumeration1.nextElement())) {}
      String s;
      for (; enumeration.hasMoreElements(); hashset.remove(s)) {
        File file4 = (File) enumeration.nextElement();
        s = file4.getAbsolutePath();
        Long long1 = (Long) fileNameMap.get(s);
        if (long1 == null) {
          if (file4.getName().equals("history.config")) {
            file = file4;
          } else if (file4.getName().equals("dynamic.config")) {
            file2 = file4;
          } else {
            array.add(file4);
          }
        } else if (long1.longValue() != file4.lastModified()) {
          if (file4.getName().equals("history.config")) {
            file1 = file4;
          } else if (file4.getName().equals("dynamic.config")) {
            file3 = file4;
          } else {
            array1.add(file4);
            if (file4.getAbsolutePath().endsWith(".mg")) {
              //                            TopazConfigurator.checkModified(file4);
            }
          }
        }
        long1 = new Long(file4.lastModified());
        fileNameMap.put(s, long1);
      }

      if (file2 != null) {
        array.add(file2);
      }
      if (file3 != null) {
        array1.add(file3);
      }
      if (file != null) {
        array.add(file);
      }
      if (file1 != null) {
        array1.add(file1);
      }
      String s1;
      for (Iterator iterator = hashset.iterator();
          iterator.hasNext();
          LogManager.log("Debug", "group deleted: " + s1)) {
        s1 = (String) iterator.next();
        fileNameMap.remove(s1);
        File file5 = new File(s1);
        array2.add(file5);
        if (file5.getAbsolutePath().endsWith(".mg")) {
          //                    TopazConfigurator.checkDeleted(file5);
        }
      }

      HashMap hashmap = new HashMap();
      siteviewgroup.adjustGroups(array, array1, array2, hashmap);
      for (HashMapIterator hashmapiterator = hashmap.begin();
          !hashmapiterator.atEnd();
          hashmapiterator.advance()) {
        fileNameMap.put(hashmapiterator.key(), hashmapiterator.value());
      }

    } catch (Exception exception) {
      LogManager.log("Error", "Error loading configuration: " + exception);
      LogManager.log("Error", "  detail: " + FileUtils.stackTraceText(exception));
    }
    clearConfigChangeFlag();
    return true;
  }