1 23 24 package com.sun.enterprise.tools.upgrade.common; 25 26 import java.io.*; 27 import java.util.*; 28 import java.util.logging.*; 29 import com.sun.enterprise.tools.upgrade.logging.*; 30 import com.sun.enterprise.util.i18n.StringManager; 31 import com.sun.enterprise.tools.upgrade.certconversion.ProcessAdaptor; 32 import com.sun.enterprise.tools.upgrade.cluster.*; 33 34 39 40 public class CommonInfoModel{ 41 public static final String DOMAINS = "domains"; 42 public static final String CONFIG = "config"; 43 private static final String CERT_FILE_NAME = "keystore.jks"; 44 private static final String TRUSTED_KEY_STORE = "cacerts.jks"; 45 private static final String LICENSE_FILE = "LICENSE.txt"; 46 private static final String NUMBERSTRING = "0123456789"; 47 48 private StringManager stringManager = StringManager.getManager(LogService.UPGRADE_LOGGER); 49 52 private static Logger logger=LogService.getLogger(LogService.UPGRADE_LOGGER); 53 private String [] CERT_ALIASES; 54 private String SOURCE_INSTALL_DIR; 55 private boolean sourceInputAsDomainRoot; 56 private boolean enlistDomain; 57 private String TARGET_INSTALL_DIR; 58 private String InstallConfig70; 59 private boolean certificateConversionFlag=false; 60 private List domainList; 61 private List domainOptionList; 62 private String targetDomainRoot; 63 private String sourceDomainRoot=""; 64 private String currentDomain; 65 private String currentSourceServerInstance = ""; 66 private String osName; 67 68 private String currentCluster; 70 71 private Hashtable domainMapping; 73 private Map domainNSSPwdMapping; 74 private Map domainTargetNSSPwdMapping; 75 private Map domainJKSPwdMapping; 76 private Map domainJKSCAPwdMapping; 77 private Map domainssPwdFileMapping; 78 private Map domainTargetnssPwdFileMapping; 79 private Map domainNameMapping; 80 private String sourceVersionEdition; 81 private String targetVersionEdition; 82 83 private String adminUserName = null; 85 private String adminPassword = null; 86 private File passwordFile = null; 87 private String passwordFilePath = null; 88 private String masterPassword = "changeit"; 89 90 public CommonInfoModel(){ 91 domainList = new ArrayList(); 92 domainOptionList = new ArrayList(); 93 domainNSSPwdMapping = new HashMap(); 94 domainTargetNSSPwdMapping = new HashMap(); 95 domainJKSPwdMapping = new HashMap(); 96 domainJKSCAPwdMapping = new HashMap(); 97 domainssPwdFileMapping= new HashMap(); 98 domainTargetnssPwdFileMapping= new HashMap(); 99 domainNameMapping= new HashMap(); 100 } 101 102 public void setTargetDomainRoot(String targetDomainsRoot) { 103 if(targetDomainRoot != null && targetDomainRoot.equals(targetDomainsRoot)) 104 return; 105 this.targetDomainRoot=targetDomainsRoot; 106 try { 107 String logPath = targetDomainRoot+File.separator+"upgrade.log"; 108 logger.info(stringManager.getString("common.log.redirect") + logPath); 109 LogService.initialize(logPath); 110 } catch(Exception e) { 111 logger.warning(e.getLocalizedMessage()); 112 } 113 } 114 115 public String getTargetDomainRoot() { 116 return targetDomainRoot; 117 } 118 119 public void setSourceDomainRoot(String sourceDomainRoot) { 120 this.sourceDomainRoot=sourceDomainRoot; 121 } 122 123 public String getSourceDomainRoot() { 124 return sourceDomainRoot; 125 } 126 public String getSourceDomainPath(){ 127 return ((DomainInfo)getDomainMapping().get(currentDomain)).getDomainPath(); 129 } 130 131 public String getSourceInstancePath(){ 132 return ((DomainInfo)this.getDomainMapping().get(this.getCurrentDomain())).getInstancePath(this.getCurrentSourceInstance()); 134 } 135 136 public String getCurrentSourceInstance() { 137 return currentSourceServerInstance; 138 } 139 140 public void setCurrentSourceInstance(String server) { 141 currentSourceServerInstance = server; 142 } 143 144 public String getTargetConfig() { 145 String config = getTargetDomainRoot() + File.separator + (String )domainNameMapping.get(currentDomain) + File.separator + CONFIG; 146 return config; 147 } 148 149 public String getTargetJKSKeyStorePath(){ 150 String path = getTargetDomainRoot() + File.separator + (String )domainNameMapping.get(currentDomain) + File.separator + CONFIG + File.separator + CERT_FILE_NAME; 151 return path; 152 } 153 154 public String getTargetTrustedJKSKeyStorePath(){ 155 String path = getTargetDomainRoot() + File.separator + (String )domainNameMapping.get(currentDomain) + File.separator + CONFIG + File.separator + TRUSTED_KEY_STORE; 156 return path; 157 } 158 159 public String getSourceJKSKeyStorePath(){ 160 String path = getSourceDomainPath() + File.separator + CONFIG + File.separator + CERT_FILE_NAME; 161 return path; 162 } 163 164 public String getSourceTrustedJKSKeyStorePath(){ 165 String path = getSourceDomainPath() + File.separator + CONFIG + File.separator + TRUSTED_KEY_STORE; 166 return path; 167 } 168 169 public String getDestinationDomainPath(){ 170 return getDestinationDomainPath(this.currentDomain); 171 } 172 public String getDestinationDomainPath(String domainName){ 173 String path = getTargetDomainRoot() + File.separator + (String )domainNameMapping.get(domainName); 174 return path; 175 } 176 177 public void addDomainName(String domainName){ 178 domainList.add(domainName); 179 } 180 181 public List getDomainList(){ 182 return domainList; 183 } 184 185 public void addDomainOptionName(String domainName){ 186 domainOptionList.add(domainName); 187 } 188 189 public List getDomainOptionList(){ 190 return domainOptionList; 191 } 192 193 public String getCurrentDomain(){ 194 return currentDomain; 195 } 196 public void setCurrentDomain(String domainName){ 197 currentDomain=domainName; 198 } 199 200 public boolean getCertificateConversionFlag() { 201 return certificateConversionFlag; 202 } 203 204 public void setCertificateConversionFlag(boolean flag){ 205 certificateConversionFlag=flag; 206 } 207 208 public String getSourceInstallDir() { 209 return SOURCE_INSTALL_DIR; 210 } 211 212 public String getTargetInstallDir() { 213 return TARGET_INSTALL_DIR; 214 } 215 216 public void setSourceInstallDir(String src) { 217 SOURCE_INSTALL_DIR = src; 218 } 219 220 public void setTargetInstallDir(String tgt) { 221 TARGET_INSTALL_DIR = tgt; 222 } 223 224 231 public String getCertDbPassword() { 232 Map instanceNSSPwdMap = (Map)domainNSSPwdMapping.get(currentDomain); 233 return (String )instanceNSSPwdMap.get(currentSourceServerInstance); 234 } 235 236 public void setCertDbPassword(String pwd) { 237 setCertDbPassword(currentDomain, currentSourceServerInstance, pwd); 238 } 239 240 public void setCertDbPassword(String domain, String pwd) { 241 setCertDbPassword(domain, currentSourceServerInstance, pwd); 242 } 243 244 public void setCertDbPassword(String domain, String instance, String pwd) { 245 Map instanceNssPwdMap = (Map)domainNSSPwdMapping.get(domain); 246 if(instanceNssPwdMap == null) { 247 instanceNssPwdMap = new HashMap(); 248 } 249 instanceNssPwdMap.put(instance, pwd); 250 domainNSSPwdMapping.put(domain,instanceNssPwdMap); 251 } 252 253 public String getTargetCertDbPassword() { 254 return (String )domainTargetNSSPwdMapping.get(currentDomain); 255 } 256 257 public void setTargetCertDbPassword(String pwd) { 258 domainTargetNSSPwdMapping.put(currentDomain,pwd); 259 } 261 public void setTargetCertDbPassword(String domain, String pwd) { 262 domainTargetNSSPwdMapping.put(domain,pwd); 263 } 264 265 public String [] getCertAliases() { 266 return CERT_ALIASES; 267 } 268 269 public String getJksKeystorePassword() { 270 return (String )domainJKSPwdMapping.get((String )domainNameMapping.get(currentDomain)); 271 } 272 273 public void setJksKeystorePassword(String pwd) { 274 domainJKSPwdMapping.put((String )domainNameMapping.get(currentDomain),pwd); 275 } 277 public void setJksKeystorePassword(String domain, String pwd) { 278 domainJKSPwdMapping.put((String )domainNameMapping.get(currentDomain),pwd); 279 } 280 281 public String getJksCAKeystorePassword() { 282 return (String )domainJKSCAPwdMapping.get((String )domainNameMapping.get(currentDomain)); 283 } 284 285 public void setJksCAKeystorePassword(String pwd) { 286 domainJKSCAPwdMapping.put((String )domainNameMapping.get(currentDomain),pwd); 287 } 288 289 public void setJksCAKeystorePassword(String domain, String pwd) { 290 domainJKSCAPwdMapping.put((String )domainNameMapping.get(currentDomain),pwd); 291 } 292 293 public Hashtable getDomainMapping() { 294 return domainMapping; 295 } 296 297 public void setDomainMapping(Hashtable domainMapping) { 298 this.domainMapping = domainMapping; 299 } 300 301 public String getOSName() { 302 return osName; 303 } 304 305 public void setOSName(String osName){ 306 this.osName = osName; 307 } 308 309 public String getNSSPwdFile() { 310 return (String )domainssPwdFileMapping.get(currentDomain); 311 } 312 313 public void setNSSPwdFile(String pwdFile){ 314 domainTargetnssPwdFileMapping.put(currentDomain,pwdFile); 315 } 316 317 public String getTargetNSSPwdFile() { 318 return (String )domainTargetnssPwdFileMapping.get(currentDomain); 319 } 320 321 public void setTargetNSSPwdFile(String pwdFile){ 322 domainTargetnssPwdFileMapping.put(currentDomain,pwdFile); 323 } 324 325 public void setInstallConfig70(String config) { 326 InstallConfig70 = config; 327 } 328 329 public String getInstallConfig70() { 330 return InstallConfig70; 331 } 332 public Map getTargetDomainNameMapping(){ 333 return domainNameMapping; 334 } 335 338 public static Logger getDefaultLogger() { 339 if (logger==null) { 340 logger = LogService.getLogger(LogService.UPGRADE_LOGGER); 341 } 342 return logger; 343 } 344 345 public boolean isUpgradeJKStoJKS() { 346 if (getTargetEdition().equals(UpgradeConstants.EDITION_PE)) { 347 if (getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS80_PE) || 348 getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS81_PE)) { 349 return true; 350 } 351 } 352 return false; 353 } 354 355 public boolean isUpgradeJKStoNSS() { 356 if (getTargetEdition().equals(UpgradeConstants.EDITION_EE) || 357 getTargetEdition().equals(UpgradeConstants.EDITION_SE)) { 358 if (getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS80_PE) || 359 getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS81_PE) || 360 getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS90_PE)) { 361 return true; 362 } 363 } 364 return false; 365 } 366 367 public boolean isUpgradeNSStoNSS() { 368 if (getTargetEdition().equals(UpgradeConstants.EDITION_EE) || 369 getTargetEdition().equals(UpgradeConstants.EDITION_SE)) { 370 if (getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_PE) || 371 getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_SE) || 372 getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_EE) || 373 getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS81_EE)) { 374 return true; 375 } 376 } 377 return false; 378 } 379 380 public boolean isUpgradeNSStoJKS() { 381 if (getTargetEdition().equals(UpgradeConstants.EDITION_PE)) { 382 if (getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_PE) || 383 getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_SE) || 384 getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_EE) || 385 getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS81_EE)){ 386 return true; 387 } 388 } 389 return false; 390 } 391 392 public boolean checkUpgradefrom7xeeto9xee() { 393 boolean checkUpgradefrom7xeeto8xee = false; 394 if(this.getSourceInstallDir() != null && this.getTargetInstallDir() != null) { 395 checkUpgradefrom7xeeto8xee = this.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_EE) && this.getTargetVersionAndEdition().equals(UpgradeConstants.VERSION_AS90_EE); 396 } 397 return checkUpgradefrom7xeeto8xee; 398 } 399 400 public boolean checkUpgradefrom8xpeto90pe() { 402 boolean checkUpgradefrom8xpeto90pe = false; 403 if(this.getSourceInstallDir() != null && this.getTargetInstallDir() != null) { 404 checkUpgradefrom8xpeto90pe = (this.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS80_PE) || 405 this.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS81_PE) || 406 this.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS82_PE)) && 407 this.getTargetVersionAndEdition().equals(UpgradeConstants.VERSION_AS90_PE); 408 } 409 return checkUpgradefrom8xpeto90pe; 410 } 411 413 public void enlistDomainsFromSource(java.util.List domains){ 414 if(domains == null) 415 this.enlistDomainsFromSource(); 416 if(enlistDomain) 417 return; 418 this.setDomainMapping(UpgradeUtils.getUpgradeUtils(this).enlistDomainsFromUserDefinedDirectories(domains)); 419 this.enlistDomain=true; 420 } 421 422 public void enlistDomainsFromSource(){ 423 if( getSourceInstallDir() == null) { 424 return; 425 } 426 if(enlistDomain) 427 return; 428 if(this.getSourceVersion().equals(UpgradeConstants.VERSION_7X)){ 429 this.setDomainMapping(UpgradeUtils.getUpgradeUtils(this).enlist70DomainsFromSource(this)); 430 }else{ 431 if(sourceIsDomain()){ 433 String source = getSourceInstallDir(); 434 if(source.endsWith(File.separator)) { 435 source = source.substring(0,source.length() - File.separator.length()); 436 } 437 String domainName = source.substring(source.lastIndexOf(File.separator) + File.separator.length(), source.length()); 438 String domainRoot = source.substring(0,source.lastIndexOf(domainName) - File.separator.length()); 439 setSourceDomainRoot(domainRoot); 440 setTargetDomainRoot(domainRoot); 441 setSourceDomainRootFlag(true); 442 setDomainMapping(UpgradeUtils.getUpgradeUtils(this).enlistDomains(this, new String [] {domainName}, domainRoot)); 443 } else { 444 if(this.getSourceDomainRootFlag()) { 445 setSourceDomainRoot(this.getSourceInstallDir()); 446 } else { 447 setSourceDomainRoot(this.getSourceInstallDir()+File.separator+"domains"); 448 } 449 this.setDomainMapping(UpgradeUtils.getUpgradeUtils(this).enlistDomainsFromDomainsDirectory(this,this.getSourceDomainRoot())); 450 } 451 enlistDomain=true; 452 } 453 } 454 455 private boolean sourceIsDomain() { 456 return UpgradeUtils.getUpgradeUtils(this).checkSourceInputAsDomain(); 457 } 458 public boolean checkSourceInputAsDomainRoot(String source) { 459 return UpgradeUtils.getUpgradeUtils(this).checkSourceInputAsDomainRoot(source,this); 460 } 461 public boolean isValid70Domain(String domainPath) { 462 return UpgradeUtils.getUpgradeUtils(this).isValid70Domain(domainPath); 463 } 464 465 public boolean isDomain(String domainPath) { 467 return UpgradeUtils.getUpgradeUtils(this).isDomain(domainPath); 468 } 469 470 public boolean getSourceDomainRootFlag() { 471 return sourceInputAsDomainRoot; 472 } 473 public void setSourceDomainRootFlag(boolean fl) { 475 this.sourceInputAsDomainRoot = fl; 476 } 477 public void printInfo(){ 478 479 getDefaultLogger().finest("SOURCE_INSTALL_DIR=="+SOURCE_INSTALL_DIR); 480 getDefaultLogger().finest("SOURCE_INSTALL_DIR=="+TARGET_INSTALL_DIR); 481 int size = domainList.size(); 482 for(int i=0;i<size;i++) { 483 String domainName = (String )domainList.get(i); 484 getDefaultLogger().finest("**********" + domainName + "****************"); 485 getDefaultLogger().finest("NSSPWD=="+ domainNSSPwdMapping.get(domainName)); 486 getDefaultLogger().finest("JKSPWD=="+ domainJKSPwdMapping.get(domainName)); 487 getDefaultLogger().finest("********************************************"); 488 } 489 490 } 491 public String getSourceServerPolicyFileName(){ 492 if(this.getSourceVersion().equals(UpgradeConstants.VERSION_7X)){ 493 return getSourceInstancePath()+File.separator+"config"+File.separator+"server.policy" ; 494 }else{ 495 return getSourceDomainPath()+File.separator+"config"+File.separator+"server.policy" ; 496 } 497 } 499 public String getTargetServerPolicyFileName(){ 500 return getDestinationDomainPath()+File.separator+"config"+File.separator+"server.policy" ; 501 } 502 public String getSourceDefaultWebXMLFileName(){ 503 if(this.getSourceVersion().equals(UpgradeConstants.VERSION_7X) || this.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS80_SE)){ 504 return getSourceInstancePath()+File.separator+"config"+File.separator+"default-web.xml" ; 505 }else{ 506 return getSourceDomainPath()+File.separator+"config"+File.separator+"default-web.xml" ; 507 } 508 } 510 public String getTargetDefaultWebXMLFileName(){ 511 return getDestinationDomainPath()+File.separator+"config"+File.separator+"default-web.xml" ; 512 } 513 public String getSourceSunACCFileName(){ 514 if(this.getSourceVersion().equals(UpgradeConstants.VERSION_7X) || this.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS80_SE)){ 515 return getSourceInstancePath()+File.separator+"config"+File.separator+"sun-acc.xml" ; 516 }else{ 517 return getSourceDomainPath()+File.separator+"config"+File.separator+"sun-acc.xml" ; 518 } 519 } 521 public String getTargetSunACCFileName(){ 522 return getDestinationDomainPath()+File.separator+"config"+File.separator+"sun-acc.xml" ; 523 } 524 public String getSourceConfigXMLFile(){ 525 if(this.getSourceVersion().equals(UpgradeConstants.VERSION_7X) || this.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS80_SE)){ 526 return getSourceInstancePath()+File.separator+"config"+File.separator+"server.xml" ; 527 }else{ 528 return getSourceDomainPath()+File.separator+"config"+File.separator+"domain.xml" ; 529 } 530 } 531 public String getTargetConfigXMLFile(){ 532 return getDestinationDomainPath()+File.separator+"config"+File.separator+"domain.xml" ; 533 } 534 535 public String getSourceVersionAndEdition(){ 536 if(this.sourceVersionEdition == null){ 537 if(getSourceInstallDir() != null){ 538 this.sourceVersionEdition = new VersionExtracter(this.getSourceInstallDir(),this).getVersion(); 539 } else { 540 return "UNKNOWN"; 541 } 542 } 543 return this.sourceVersionEdition; 544 } 545 public String getTargetVersionAndEdition(){ 546 549 return this.targetVersionEdition; 550 } 551 public void setTargetVersionAndEdition(String verEd){ 552 if(verEd.equals("AS90PE")){ 554 this.targetVersionEdition = UpgradeConstants.VERSION_AS90_PE; 555 }else{ 556 this.targetVersionEdition = UpgradeConstants.VERSION_AS90_EE; 558 } 559 } 560 public void clearSourceAndTargetVersions(){ 561 this.sourceVersionEdition = null; 563 } 565 public String getSourceVersion(){ 566 return UpgradeUtils.getUpgradeUtils(this).versionString(this.getSourceVersionAndEdition()); 567 } 568 public String getTargetVersion(){ 569 return UpgradeUtils.getUpgradeUtils(this).versionString(this.getTargetVersionAndEdition()); 570 } 571 public String getSourceEdition(){ 572 return UpgradeUtils.getUpgradeUtils(this).editionString(this.getSourceVersionAndEdition()); 573 } 574 public String getTargetEdition(){ 575 return UpgradeUtils.getUpgradeUtils(this).editionString(this.getTargetVersionAndEdition()); 576 } 577 public boolean isUpgradeSupported(){ 578 if (getSourceVersionAndEdition().equals(getTargetVersionAndEdition())) { 579 logger.info(stringManager.getString("sameVersionUpgradeNotRequired")); 580 return false; 581 } 582 return ((java.util.HashSet )UpgradeConstants.supportMap.get(getSourceVersionAndEdition())).contains(getTargetVersionAndEdition()); 583 } 584 public boolean isUpgradeSupported(String src, String targ){ 585 if(src.equals(targ)) return false; 586 return ((java.util.HashSet )UpgradeConstants.supportMap.get(src)).contains(targ); 587 } 588 public boolean extractVersionDetails(){ 589 this.sourceVersionEdition = new VersionExtracter(this.getSourceInstallDir(),this).getVersion(); 590 if((this.sourceVersionEdition == null) || (this.targetVersionEdition == null)) 592 return false; 593 return true; 594 } 595 public String getCurrentCluster(){ 596 return this.currentCluster; 597 } 598 public void setCurrentCluster(String clu){ 599 this.currentCluster = clu; 600 } 601 public String findLatestDomainDir(String domainRoot) { 602 return UpgradeUtils.getUpgradeUtils(this).findLatestDomainDir(domainRoot,currentDomain); 603 } 604 public String getAdminUserName(){ 605 return this.adminUserName; 606 } 607 608 public void setAdminUserName(String adminUserName){ 609 this.adminUserName=adminUserName ; 610 } 611 612 public String getAdminPassword(){ 613 return this.adminPassword; 614 } 615 616 public void setAdminPassword(String adminPassword){ 617 this.adminPassword = adminPassword; 618 } 619 620 public String getPasswordFile() { 621 if (passwordFilePath == null) { 622 try { 623 passwordFile = java.io.File.createTempFile("ugpw", null); 624 FileWriter writer = new FileWriter(passwordFile); 625 writer.write("AS_ADMIN_PASSWORD=" + getAdminPassword() +"\n"); 626 writer.write("AS_ADMIN_ADMINPASSWORD=" + getAdminPassword() +"\n"); 627 writer.write("AS_ADMIN_MASTERPASSWORD=" + getMasterPassword() + "\n"); 628 writer.close(); 629 passwordFilePath = passwordFile.getAbsolutePath(); 630 } catch (IOException ioe) { 631 logger.severe(stringManager.getString("command.generalException") + " " + ioe.getMessage()); 632 633 } 634 } 635 return passwordFilePath; 636 } 637 638 public void setPasswordsFromFile(String path) { 639 try { 640 File userPasswordFile = new File(path); 641 BufferedReader reader = new BufferedReader(new FileReader(userPasswordFile)); 642 while( reader.ready() ) { 643 String line = reader.readLine(); 644 if ( line.startsWith("AS_ADMIN_PASSWORD=") ) { 645 setAdminPassword(line.substring(line.indexOf("=") + 1)); 646 } else if ( line.startsWith("AS_ADMIN_ADMINPASSWORD=") ) { 647 setAdminPassword(line.substring(line.indexOf("=") + 1)); 648 } else if ( line.startsWith("AS_ADMIN_MASTERPASSWORD=") ) { 649 setMasterPassword(line.substring(line.indexOf("=") + 1)); 650 } 651 } 652 reader.close(); 653 } catch (Exception e) { 654 logger.severe(stringManager.getString("command.generalException") + " " + e.getMessage()); 655 } 656 } 657 658 public void setMasterPassword(String pw) { 659 masterPassword = pw; 660 } 661 public String getMasterPassword() { 662 return masterPassword; 663 } 664 665 public void deletePasswordFile() { 666 if (passwordFile != null) { 667 passwordFile.delete(); 668 } 669 } 670 671 public String getSourceInitConfFileName(){ 672 if(this.getSourceVersion().equals(UpgradeConstants.VERSION_7X)) { 673 return getSourceInstancePath()+File.separator+"config"+File.separator+"init.conf" ; 674 }else{ 675 return null; 676 } 677 } 678 679 public void recover() { 680 UpgradeUtils.getUpgradeUtils(this).recover(); 681 } 682 public boolean processClinstnceConfFiles(Vector files){ 683 return ClustersInfoManager.getClusterInfoManager().processClinstanceConfFiles(files); 684 } 685 } 686 | Popular Tags |