예제 #1
0
 public LocalizedMessage getRollBackMessage(IStateAccess stateAccess, Map properties) {
   String serverXMLFile = getServiceXMLFile(stateAccess);
   Object[] args = {serverXMLFile};
   LocalizedMessage message =
       LocalizedMessage.get(LOC_TSK_MSG_CONFIGURE_SERVICE_XML_ROLLBACK, STR_JB_GROUP, args);
   return message;
 }
  /**
   * Returns the product home directory if the locator file is present or returns null. If null =>
   * first time install
   *
   * @return the product home directory
   * @throws InstallException
   */
  protected String getProductHome(IStateAccess stateAccess) throws InstallException {
    String serverHomeDir = getServerHomeDir(stateAccess);
    setProductLocatorFile(serverHomeDir + FILE_SEP + STR_LOCATOR_FILE_NAME);

    String productHome = null;
    File file = new File(getProductLocatorFile());
    if (file.exists() && file.canRead()) {
      // Found old install
      productHome = readProductHome();
      validateProductHome(productHome, getProductLocatorFile());

      if (!productHome.equals(ConfigUtil.getHomePath())) {
        Debug.log(
            "MigrateServerLocatorHandler.validateProductHome() : "
                + "old Product home: "
                + productHome
                + ", New Product Home: "
                + ConfigUtil.getHomePath());

      } else {
        Debug.log("MigrateServerLocatorHandler - Error:" + "This agent has been already migrated!");

        throw new InstallException(LocalizedMessage.get(LOC_DR_ERR_PRODUCT_ALREADY_MIGRATED));
      }
    }

    return productHome;
  }
예제 #3
0
 public LocalizedMessage getExecutionMessage(IStateAccess stateAccess, Map properties) {
   String serverXMLFile = getDomainXMLFile(stateAccess);
   Object[] args = {serverXMLFile};
   LocalizedMessage message =
       LocalizedMessage.get(LOC_TSK_MSG_CONFIGURE_DOMAIN_XML_EXECUTE, STR_AS_GROUP, args);
   return message;
 }
예제 #4
0
  public LocalizedMessage getExecutionMessage(IStateAccess stateAccess, Map properties) {
    Object[] args = {STR_AGENT_APP_WAR_FILE};
    LocalizedMessage message =
        LocalizedMessage.get(LOC_TSK_MSG_CONFIGURE_AGENT_APP_EXECUTE, STR_JB_GROUP, args);

    return message;
  }
예제 #5
0
  public LocalizedMessage getExecutionMessage(IStateAccess stateAccess, Map properties) {
    String serverXMLFile = getServerXMLFile(stateAccess);
    Object[] args = {serverXMLFile};
    LocalizedMessage message =
        LocalizedMessage.get(LOC_TSK_MSG_UNCONFIGURE_SERVER_XML_EXECUTE, STR_TOMCAT_GROUP, args);

    return message;
  }
 private void validateProductHome(String productHome, String locatorFile) throws InstallException {
   if (productHome == null || productHome.trim().length() == 0) {
     Debug.log(
         "MigrateServerLocatorHandler : Error invalid product home"
             + " property '"
             + IAdminTool.PROP_PRODUCT_HOME
             + " = "
             + productHome
             + "' in file "
             + locatorFile);
     throw new InstallException(LocalizedMessage.get(LOC_DR_ERR_APP_SERVER_HOME_LOCATOR));
   }
 }
  /**
   * Backup the old product home directory before migration.
   *
   * @throws InstallException
   */
  protected void backupProductHome() throws InstallException {

    String locatorFile = getProductLocatorFile();
    try {
      FileUtils.backupFile(locatorFile, STR_BACK_UP_FILE_SUFFIX);
      saveProductHome();

    } catch (Exception e) {
      Debug.log(
          "MigrateServerLocatorHandler - Error occurred "
              + "while backup and deletion for file: '"
              + locatorFile
              + "'.");
      Object[] args = {locatorFile};
      throw new InstallException(LocalizedMessage.get(LOC_DR_ERR_PRODUCT_LOCATOR_BACKUP, args));
    }
  }
예제 #8
0
 public LocalizedMessage getRollBackMessage(IStateAccess stateAccess, Map properties) {
   Object[] args = {STR_AGENT_APP_WAR_FILE};
   LocalizedMessage message =
       LocalizedMessage.get(LOC_TSK_MSG_CONFIGURE_AGENT_APP_ROLLBACK, STR_JB_GROUP, args);
   return message;
 }