Ejemplo n.º 1
0
 protected Installation findProcessInstallation(String id) {
   List<Installation> installations = processManager.listInstallations();
   for (Installation installation : installations) {
     String name = installation.getName();
     if (Objects.equal(id, name)) {
       return installation;
     }
   }
   return null;
 }
Ejemplo n.º 2
0
  Installation provisionProcess(ProcessRequirements requirements) throws Exception {
    // TODO check that the installation is the same
    uninstallProcess(requirements);

    String id = requirements.getId();
    InstallOptions installOptions = requirements.createInstallOptions();
    Profile processProfile = getProcessProfile(requirements, true);
    Profile deployProcessProfile = getProcessProfile(requirements, false);
    Map<String, String> configuration = getProcessLayout(processProfile, requirements.getLayout());

    DownloadManager downloadManager =
        DownloadManagers.createDownloadManager(fabricService, processProfile, executorService);
    InstallTask applyConfiguration =
        new ApplyConfigurationTask(configuration, installOptions.getProperties());
    InstallTask applyProfile = new DeploymentTask(downloadManager, deployProcessProfile);
    InstallTask compositeTask = new CompositeTask(applyConfiguration, applyProfile);
    Installation installation = processManager.install(installOptions, compositeTask);
    if (installation != null) {
      installation.getController().start();
    }
    return installation;
  }