Beispiel #1
0
 protected long getDownloadSize(List<AppUpdate> updates) {
   long fileSizes = 0;
   for (AppUpdate list : updates) {
     fileSizes += list.getTotalUpdateSize();
   }
   return fileSizes;
 }
Beispiel #2
0
 protected List<String> getDeletionList(List<AppUpdate> updates) {
   List<String> fileNames = new ArrayList<String>();
   for (AppUpdate list : updates) {
     fileNames.addAll(list.getDeletionNames());
   }
   return fileNames;
 }
Beispiel #3
0
 protected Map<String, String> getMd5Map() {
   List<AppUpdate> updatesList = getUpdatesList();
   if (updatesList == null) return null;
   Map<String, String> map = new HashMap<String, String>();
   for (AppUpdate list : updatesList) {
     map.putAll(list.getMd5Map());
   }
   return map;
 }
Beispiel #4
0
 protected List<String> getDownloadList(List<AppUpdate> updates) {
   consolidateLibs(updates);
   List<String> fileNames = new ArrayList<String>();
   for (AppUpdate list : updates) {
     if (list.isControlPanelApp()) {
       _updatingThis = true;
     }
     fileNames.addAll(list.getDownloadNames());
   }
   return fileNames;
 }
Beispiel #5
0
 protected void doUninstalls(File tomcatRoot) {
   List<String> webappsToRemove = new ArrayList<String>();
   for (AppUpdate appUpdate : _installs) {
     if (appUpdate.hasDeletions() && appUpdate.isAppList()) {
       webappsToRemove.add(appUpdate.getAppName());
     }
   }
   for (String name : webappsToRemove) {
     String path = FileUtil.buildPath(tomcatRoot.getAbsolutePath(), "webapps", name);
     FileUtil.purgeDir(new File(path));
   }
 }
Beispiel #6
0
 private List<AppUpdate> consolidateLibs(List<AppUpdate> updates) {
   List<AppUpdate> appList = new ArrayList<AppUpdate>();
   AppUpdate libAppUpdate = new AppUpdate(null);
   for (AppUpdate upList : updates) {
     if (upList.isAppList()) {
       appList.add(upList);
     } else {
       libAppUpdate.merge(upList);
     }
   }
   if (!libAppUpdate.isEmpty()) appList.add(libAppUpdate);
   return appList;
 }
Beispiel #7
0
  private void updateServiceRegistration() {
    Registrar registrar = new Registrar();
    for (AppUpdate appUpdate : _installs) {
      if (appUpdate.isServiceApp()) {
        boolean success;
        String appName = appUpdate.getAppName();
        if (appUpdate.hasDeletions()) {
          try {
            success = registrar.remove(appName);
          } catch (IOException ioe) {
            success = false;
          }
          if (!success) {
            showWarning(
                "Service '"
                    + appName
                    + "' has been successfully "
                    + "removed, but\n"
                    + "failed to deregister from the YAWL Engine.");
          }
        } else if (appUpdate.hasDownloads()) {
          WebXmlReader webXml = new WebXmlReader(appName);
          String password = webXml.getContextParam("EngineLogonPassword");
          String mapping = webXml.getIBServletMapping();
          if (password != null) {
            String url = mapping == null ? null : "http://localhost:8080/" + appName + mapping;
            try {
              success = registrar.add(appName, password, url);
            } catch (IOException ioe) {
              success = false;
            }
          } else success = false;

          if (!success) {
            showWarning(
                "Service '"
                    + appName
                    + "' has been successfully "
                    + "added, but\n"
                    + "failed to register with the YAWL Engine.");
          }
        }
      }
    }
    registrar.disconnect();
  }