Package org.nasutekds.quicksetup

Examples of org.nasutekds.quicksetup.Installation


      System.getProperty(SYS_PROP_INSTANCE_ROOT);
    if (installRootFromSystem != null)
    {
      if (instanceRootFromSystem != null)
      {
        setInstallation(new Installation(installRootFromSystem,
            instanceRootFromSystem));
      } else
      {
        setInstallation(new Installation(installRootFromSystem,
            installRootFromSystem));
      }
    }

  }
View Full Code Here


            File serverLocation = new File(serverLocationString);
            Installation.validateRootDirectory(serverLocation);

            // If we get here the value is acceptable and not null

            Installation currentInstallation = getInstallation();
            if (currentInstallation == null ||
                !serverLocation.equals(getInstallation().getRootDirectory())) {
              LOG.log(Level.INFO,
                      "user changed server root from " +
                      (currentInstallation == null ?
                              "'null'" :
                              currentInstallation.getRootDirectory()) +
                      " to " + serverLocation);
              Installation installation = new Installation(serverLocation,
                  serverLocation);
              setInstallation(installation);
              try
              {
                // Try to see if there is a problem with the build information,
                // we might be trying to do the upgrade with a JVM that is not
                // compatible with the java arguments used by the server
                // scripts (see issue ).
                installation.getBuildInformation(true);
              }
              catch (ApplicationException ae)
              {
                if (ae.getMessageObject().getDescriptor().equals(
                    INFO_ERROR_CREATING_BUILD_INFO_MSG))
                {
                  // This is the message thrown when there was a problem with
                  // the binary.  The details content is on the scripts and not
                  // localized, we can assume that if there is a mention to
                  // NASUTEKDS_JAVA_HOME in the message there is an error with the
                  // script.
                  if (ae.getMessageObject().toString().indexOf(
                      "NASUTEKDS_JAVA_HOME") != -1)
                  {
                    String javaBin = System.getProperty("java.home")+
                    File.separator+
                    "bin"+File.separator+"java";
                    String setJavaHome =
                      installation.getSetJavaHomeFile().getAbsolutePath();
                    String dsJavaProperties =
                      installation.getJavaPropertiesCommandFile().
                      getAbsolutePath();
                    errorMsgs.add(ERR_INVALID_JAVA_ARGS.get(
                        serverLocationString,
                        javaBin,
                        setJavaHome,
View Full Code Here

      List<Message> errors;
      try {
        LOG.log(Level.INFO, "verifying upgrade");
        setCurrentProgressStep(UpgradeProgressStep.VERIFYING);
        Installation installation = getInstallation();
        ServerHealthChecker healthChecker =
                new ServerHealthChecker(installation);
        healthChecker.checkServer();
        errors = healthChecker.getProblemMessages();
      } catch (Exception e) {
View Full Code Here

   * @throws ApplicationException if upgrade fails
   */
  protected void upgradeComponents() throws ApplicationException {
    try {
      Stage stage = getStage();
      Installation installation = getInstallation();
      File root = installation.getRootDirectory();

      if (instanceAndInstallInSameDir())
      {
       stage.move(root, new UpgradeFileFilter(getStageDirectory()));
      }
      else
      {
         stage.move(root, new UpgradeFileFilter(getStageDirectory(),true));
        root = installation.getInstanceDirectory();
        stage.move(root, new UpgradeFileFilter(getStageDirectory(),false));
      }

      // Check if instance.loc exits
      File instanceFile = new File
         (installation.getRootDirectory(),
            Installation.INSTANCE_LOCATION_PATH_RELATIVE);
      if (! instanceFile.exists())
      {
        BufferedWriter instanceLoc =
          new BufferedWriter(new FileWriter(instanceFile));
        instanceLoc.append(
            installation.getInstanceDirectory().getAbsolutePath());
        instanceLoc.close();
      }

      // The bits should now be of the new version.  Have
      // the installation update the build information so
      // that it is correct.
      LOG.log(Level.INFO, "upgraded bits to " +
              installation.getBuildInformation(false));

    } catch (IOException e) {
      throw ApplicationException.createFileSystemException(
              INFO_ERROR_UPGRADING_COMPONENTS.get(), e);
    }
View Full Code Here

          throws IOException, ApplicationException {
    if (stagedInstallation == null) {
      File stageDir = getStageDirectory();
      try {
        Installation.validateRootDirectory(stageDir);
        stagedInstallation = new Installation(getStageDirectory(),
            getStageDirectory());
      } catch (IllegalArgumentException e) {
        Message msg = INFO_ERROR_BAD_STAGE_DIRECTORY.get(
                Utils.getPath(getStageDirectory()));
        throw ApplicationException.createFileSystemException(msg, e);
View Full Code Here

    return (UpgradeUserData) getUserData();
  }

  private boolean instanceAndInstallInSameDir()
  {
    Installation installation = getInstallation() ;
    File installDir  = installation.getRootDirectory();
    try
    {
      installDir = installDir.getCanonicalFile();
    }
    catch (Exception e) {
      installDir  = installation.getRootDirectory();
    }
    File instanceDir = installation.getInstanceDirectory();
    try
    {
      instanceDir = instanceDir.getCanonicalFile();
    }
    catch (Exception e) {
      instanceDir = installation.getInstanceDirectory();
    }
    return installDir.getAbsolutePath().equals(instanceDir.getAbsolutePath());
  }
View Full Code Here

      System.getProperty(SYS_PROP_INSTANCE_ROOT);
    if (installRootFromSystem != null)
    {
      if (instanceRootFromSystem != null)
      {
        setInstallation(new Installation(installRootFromSystem,
            instanceRootFromSystem));
      } else
      {
        setInstallation(new Installation(installRootFromSystem,
            installRootFromSystem));
      }
    }

  }
View Full Code Here

            File serverLocation = new File(serverLocationString);
            Installation.validateRootDirectory(serverLocation);

            // If we get here the value is acceptable and not null

            Installation currentInstallation = getInstallation();
            if (currentInstallation == null ||
                !serverLocation.equals(getInstallation().getRootDirectory())) {
              LOG.log(Level.INFO,
                      "user changed server root from " +
                      (currentInstallation == null ?
                              "'null'" :
                              currentInstallation.getRootDirectory()) +
                      " to " + serverLocation);
              Installation installation = new Installation(serverLocation,
                  serverLocation);
              setInstallation(installation);
              try
              {
                // Try to see if there is a problem with the build information,
                // we might be trying to do the upgrade with a JVM that is not
                // compatible with the java arguments used by the server
                // scripts (see issue ).
                installation.getBuildInformation(true);
              }
              catch (ApplicationException ae)
              {
                if (ae.getMessageObject().getDescriptor().equals(
                    INFO_ERROR_CREATING_BUILD_INFO_MSG))
                {
                  // This is the message thrown when there was a problem with
                  // the binary.  The details content is on the scripts and not
                  // localized, we can assume that if there is a mention to
                  // NASUTEKDS_JAVA_HOME in the message there is an error with the
                  // script.
                  if (ae.getMessageObject().toString().indexOf(
                      "NASUTEKDS_JAVA_HOME") != -1)
                  {
                    String javaBin = System.getProperty("java.home")+
                    File.separator+
                    "bin"+File.separator+"java";
                    String setJavaHome =
                      installation.getSetJavaHomeFile().getAbsolutePath();
                    String dsJavaProperties =
                      installation.getJavaPropertiesCommandFile().
                      getAbsolutePath();
                    errorMsgs.add(ERR_INVALID_JAVA_ARGS.get(
                        serverLocationString,
                        javaBin,
                        setJavaHome,
View Full Code Here

      List<Message> errors;
      try {
        LOG.log(Level.INFO, "verifying upgrade");
        setCurrentProgressStep(UpgradeProgressStep.VERIFYING);
        Installation installation = getInstallation();
        ServerHealthChecker healthChecker =
                new ServerHealthChecker(installation);
        healthChecker.checkServer();
        errors = healthChecker.getProblemMessages();
      } catch (Exception e) {
View Full Code Here

   * @throws ApplicationException if upgrade fails
   */
  protected void upgradeComponents() throws ApplicationException {
    try {
      Stage stage = getStage();
      Installation installation = getInstallation();
      File root = installation.getRootDirectory();

      if (instanceAndInstallInSameDir())
      {
       stage.move(root, new UpgradeFileFilter(getStageDirectory()));
      }
      else
      {
         stage.move(root, new UpgradeFileFilter(getStageDirectory(),true));
        root = installation.getInstanceDirectory();
        stage.move(root, new UpgradeFileFilter(getStageDirectory(),false));
      }

      // Check if instance.loc exits
      File instanceFile = new File
         (installation.getRootDirectory(),
            Installation.INSTANCE_LOCATION_PATH_RELATIVE);
      if (! instanceFile.exists())
      {
        BufferedWriter instanceLoc =
          new BufferedWriter(new FileWriter(instanceFile));
        instanceLoc.append(
            installation.getInstanceDirectory().getAbsolutePath());
        instanceLoc.close();
      }

      // The bits should now be of the new version.  Have
      // the installation update the build information so
      // that it is correct.
      LOG.log(Level.INFO, "upgraded bits to " +
              installation.getBuildInformation(false));

    } catch (IOException e) {
      throw ApplicationException.createFileSystemException(
              INFO_ERROR_UPGRADING_COMPONENTS.get(), e);
    }
View Full Code Here

TOP

Related Classes of org.nasutekds.quicksetup.Installation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.