FileDocCategorySizeDatePackage
MainFrame.javaAPI DocGlassfish v2 API35385Tue Aug 28 14:42:20 BST 2007com.sun.enterprise.tools.upgrade.gui

MainFrame

public class MainFrame extends JFrame implements UpgradeUpdateListener, LogMessageListener
Insert the type's description here.
author:
Prakash Aradhya

Fields Summary
private JButton
backButton
private JPanel
buttonsPanel
private JButton
cancelButton
private JButton
helpButton
private JPanel
JDialogContentPane
private JButton
nextButton
private JPanel
navigationPanel
private int
currentNavigationPanel
private ProgressPanel
progressPanel
private DataCollectionPanel
dataCollectionPanel
private CertificatePanel
certificatePanel
private ClusterDetailsPanel
clusterDetailsPanel
private CommonInfoModel
commonInfoModel
private DomainPathSelectionDialog
domainPathSelectionDialog
private Vector
dialogListeners
private com.sun.enterprise.util.i18n.StringManager
stringManager
private static Logger
logger
private static final int
DETAILS_COLLECTION_PANEL
private static final int
CERTIFICATE_PANEL
private static final int
PROGRESS_PANEL
private static final int
CLUSTER_DETAILS_PANEL
private static int
UPGRADE_STARTED
private static int
UPGRADE_FINISHED
private static int
DATA_COLLECTION_PENDING
private static int
CRTIFICATION_PENDING
private static int
CLUSTER_DETAILS_PENDING
EventHandler
eventHandler
Constructors Summary
public MainFrame(CommonInfoModel coInfoModel)
MainFrame constructor


           
       
        super.setTitle(stringManager.getString(
                "upgrade.gui.mainframe.titleMessage", 
                coInfoModel.getTargetVersion()));
        this.commonInfoModel = coInfoModel;
        initialize();
    
Methods Summary
public voidaddDialogListener(com.sun.enterprise.tools.upgrade.gui.util.DialogListener listener)

        this.dialogListeners.addElement(listener);
    
public voidcenterDialog(javax.swing.JDialog dialog)

        java.awt.Rectangle bounds = this.getBounds();
        java.awt.Rectangle dialogLocation = new java.awt.Rectangle();
        dialogLocation.x = bounds.x+((bounds.width-dialog.getWidth())/2);
        dialogLocation.y = bounds.y+((bounds.height-dialog.getHeight())/2);
        dialogLocation.setSize(dialog.getWidth(),dialog.getHeight());
        dialog.setBounds(dialogLocation);
    
private javax.swing.JPanelgetCertificatePanel()

        if (certificatePanel == null) {
            certificatePanel = new CertificatePanel(this.commonInfoModel, this);
        }
        return certificatePanel;
    
private javax.swing.JPanelgetClusterDetailsPanel()

        if (clusterDetailsPanel == null) {
            clusterDetailsPanel = new ClusterDetailsPanel();
            clusterDetailsPanel.addDialogListener(new DialogListener(){
            public void dialogProcessed(DialogEvent evt){
                //setNextButtonStateForClusterDetailsPanel();
            }
        });
        }
        return clusterDetailsPanel;
    
private javax.swing.JPanelgetDataCollectionPanel()

        if (dataCollectionPanel == null) {
            dataCollectionPanel = new DataCollectionPanel(commonInfoModel);
        }
        return dataCollectionPanel;
    
private DomainPathSelectionDialoggetDomainPathSelectionDialog()

        if(this.domainPathSelectionDialog == null){
            domainPathSelectionDialog = new DomainPathSelectionDialog();
            centerDialog(domainPathSelectionDialog);
            domainPathSelectionDialog.addDialogListener(new DialogListener(){
                public void dialogProcessed(DialogEvent evt){
                    
                }
            });
        }
        return domainPathSelectionDialog;
    
public javax.swing.JPanelgetJDialogContentPane()
Return the JDialogContentPane property value.

return
javax.swing.JPanel

        if (JDialogContentPane == null) {
            JDialogContentPane = new javax.swing.JPanel();
            JDialogContentPane.setName("JDialogContentPane");
            JDialogContentPane.setLayout(new java.awt.GridBagLayout());

            java.awt.GridBagConstraints imageconstraintsPanel = new java.awt.GridBagConstraints();
            imageconstraintsPanel.gridx = 0; imageconstraintsPanel.gridy = 0;
            imageconstraintsPanel.fill = java.awt.GridBagConstraints.BOTH;
            imageconstraintsPanel.weightx = 0;
            imageconstraintsPanel.weighty = 0;
            ImagePanel imagePanel = new ImagePanel(new java.awt.Insets(5,10,5,10));
            java.awt.Image image = this.getUpgradeToolImage();
            //imagePanel.setImage(java.awt.Toolkit.getDefaultToolkit().createImage("C:\\Sources\\ASUTws\\tools\\src\\java\\com\\sun\\enterprise\\tools\\upgrade\\gui\\Appserv_upgrade_wizard.gif"));
            imagePanel.setImage(image);
            getJDialogContentPane().add(imagePanel, imageconstraintsPanel);

            java.awt.GridBagConstraints constraintsnavigationPanel = new java.awt.GridBagConstraints();
            constraintsnavigationPanel.gridx = 1; constraintsnavigationPanel.gridy = 0;
            constraintsnavigationPanel.fill = java.awt.GridBagConstraints.BOTH;
            constraintsnavigationPanel.weightx = 1.0;
            constraintsnavigationPanel.weighty = 1.0;
            getJDialogContentPane().add(getnavigationPanel(), constraintsnavigationPanel);

            java.awt.GridBagConstraints constraintsSeparator = new java.awt.GridBagConstraints();
            constraintsSeparator.gridx = 0; constraintsSeparator.gridy = 1;
            constraintsSeparator.gridwidth = 2; constraintsSeparator.gridheight = 1;
            constraintsSeparator.fill = java.awt.GridBagConstraints.HORIZONTAL;
            constraintsSeparator.weightx = 1.0;
            constraintsSeparator.insets = new java.awt.Insets(5, 0, 0, 0);
            javax.swing.JSeparator separatorPanel = new javax.swing.JSeparator();
            getJDialogContentPane().add(separatorPanel, constraintsSeparator);

            java.awt.GridBagConstraints constraintsbuttonsPanel = new java.awt.GridBagConstraints();
            constraintsbuttonsPanel.gridx = 0; constraintsbuttonsPanel.gridy = 2;
            constraintsbuttonsPanel.gridwidth = 2; constraintsbuttonsPanel.gridheight = 1;
            constraintsbuttonsPanel.fill = java.awt.GridBagConstraints.HORIZONTAL;
            constraintsbuttonsPanel.weightx = 1.0;
            constraintsbuttonsPanel.insets = new java.awt.Insets(5, 0, 0, 0);
            getJDialogContentPane().add(getbuttonsPanel(), constraintsbuttonsPanel);
        }
        return JDialogContentPane;
    
private javax.swing.JPanelgetProgressPanel()
Return the JPanel1 property value.

return
javax.swing.JPanel

        if (progressPanel == null) {
            progressPanel = new ProgressPanel();
        }
        return progressPanel;
    
private java.awt.ImagegetUpgradeToolImage()

        java.net.URL imageURL = ClassLoader.getSystemClassLoader().getResource("com/sun/enterprise/tools/upgrade/gui/Appserv_upgrade_wizard.gif");
        return (imageURL != null)? java.awt.Toolkit.getDefaultToolkit().getImage(imageURL) : null;
    
private java.util.ListgetUserDefinedSourceDomains(CommonInfoModel commonInfoModel)

        int returnedOption = javax.swing.JOptionPane.showConfirmDialog(this, stringManager.getString("upgrade.gui.mainframe.multiplDomainsMsg"),
						      stringManager.getString("upgrade.gui.mainframe.multiplDomainsTitle"),
						      javax.swing.JOptionPane.YES_NO_OPTION,javax.swing.JOptionPane.QUESTION_MESSAGE);
        if(returnedOption == javax.swing.JOptionPane.NO_OPTION)
            return null;
        // Bring up the dialog here.
        this.getDomainPathSelectionDialog().show();
        // The dialog is modal untill it is closed.
        if(this.getDomainPathSelectionDialog().USER_ACTION == DomainPathSelectionDialog.CANCEL_ACTION){
            return null;
        }else{
            return this.getDomainPathSelectionDialog().getDomainPathTableModel().getDomainPaths();
        }
    
private javax.swing.JButtongetbackButton()
Return the backButton property value.

return
javax.swing.JButton

        if (backButton == null) {
            backButton = new javax.swing.JButton();
            backButton.setName("backButton");
            backButton.setText(stringManager.getString("upgrade.gui.mainframe.backbutton"));
        }
        return backButton;
    
private javax.swing.JPanelgetbuttonsPanel()
Return the buttonsPanel property value.

return
javax.swing.JPanel

        if (buttonsPanel == null) {
            buttonsPanel = new javax.swing.JPanel();
            buttonsPanel.setName("buttonsPanel");
            buttonsPanel.setLayout(new java.awt.GridBagLayout());
            JPanel placeHolderPanel1 = new JPanel();
            JPanel placeHolderPanel2 = new JPanel();
            placeHolderPanel1.add(getbackButton());
            placeHolderPanel1.add(getnextButton());
            placeHolderPanel2.add(getcancelButton());
            placeHolderPanel2.add(gethelpButton());

            java.awt.GridBagConstraints constraints = new java.awt.GridBagConstraints();
            constraints.gridx = 0; constraints.gridy = 0;
            constraints.anchor = java.awt.GridBagConstraints.WEST;
            constraints.gridwidth = 1; constraints.gridheight = 1;
            constraints.weightx = 1.0; constraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
            constraints.insets = new java.awt.Insets(5, 10, 10, 20);
            getbuttonsPanel().add(placeHolderPanel1, constraints);

            constraints = new java.awt.GridBagConstraints();
            constraints.gridx = 1; constraints.gridy = 0;
            constraints.anchor = java.awt.GridBagConstraints.EAST;
            constraints.gridwidth = 1; constraints.gridheight = 1;
            constraints.weightx = 1.0; constraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
            constraints.insets = new java.awt.Insets(5, 10, 10, 20);
            getbuttonsPanel().add(placeHolderPanel2, constraints);
        }
        return buttonsPanel;
    
private javax.swing.JButtongetcancelButton()
Return the cancelButton property value.

return
javax.swing.JButton

        if (cancelButton == null) {
            cancelButton = new javax.swing.JButton();
            cancelButton.setName("cancelButton");
            cancelButton.setText(stringManager.getString("upgrade.gui.mainframe.cancelbutton"));
        }
        return cancelButton;
    
private javax.swing.JButtongethelpButton()
Return the helpButton property value.

return
javax.swing.JButton

        if (helpButton == null) {
            helpButton = new javax.swing.JButton();
            helpButton.setName("helpButton");
            helpButton.setText(stringManager.getString("upgrade.gui.mainframe.helpbutton"));
            if(Utils.getHelpBroker() != null)
                Utils.getHelpBroker().enableHelpOnButton(helpButton, "WIZARD_FIRST", null);
        }
        return helpButton;
    
private javax.swing.JPanelgetnavigationPanel()
Return the navigationPanel property value.

return
javax.swing.JPanel

        if (navigationPanel == null) {
            navigationPanel = new javax.swing.JPanel();
            navigationPanel.setName("navigationPanel");
            navigationPanel.setLayout(new java.awt.GridBagLayout());

            java.awt.GridBagConstraints constraintsbeanNameBeanTypePanel = new java.awt.GridBagConstraints();
            constraintsbeanNameBeanTypePanel.gridx = 0; constraintsbeanNameBeanTypePanel.gridy = 0;
            constraintsbeanNameBeanTypePanel.fill = java.awt.GridBagConstraints.BOTH;
            constraintsbeanNameBeanTypePanel.weightx = 1.0;
            constraintsbeanNameBeanTypePanel.weighty = 1.0;
            getnavigationPanel().add(getDataCollectionPanel(), constraintsbeanNameBeanTypePanel);
        }
        return navigationPanel;
    
private javax.swing.JButtongetnextButton()
Return the nextButton property value.

return
javax.swing.JButton

        if (nextButton == null) {
            nextButton = new javax.swing.JButton();
            nextButton.setName("nextButton");
            nextButton.setText(stringManager.getString("upgrade.gui.mainframe.nextbutton"));
            nextButton.setActionCommand("next");
        }
        return nextButton;
    
private voidinitConnections()
Initializes connections

exception
java.lang.Exception The exception description.

        getcancelButton().addActionListener(eventHandler);
        getbackButton().addActionListener(eventHandler);
        getnextButton().addActionListener(eventHandler);
        gethelpButton().addActionListener(eventHandler);
        dataCollectionPanel.addDialogListener(new DialogListener(){
            public void dialogProcessed(DialogEvent evt){
                setNextButtonStateForDataCollectionPanel();
            }
        });
        this.addWindowListener(new java.awt.event.WindowAdapter(){
            public void windowClosing(java.awt.event.WindowEvent e){
                processCancelAction();
            }
        });
    
private voidinitialize()
Initialize the class.

        setName("MainFrame");
        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setSize(725, 545);
        setContentPane(getJDialogContentPane());
        initConnections();
        this.setFrameNavigationState(this.DATA_COLLECTION_PENDING);
        this.setBounds(new java.awt.Rectangle(100,100,this.getWidth(),this.getHeight()));
    
public voidlogMessageReceived(LogMessageEvent evt)

        // retrive message and show it in Process panel.
        if(this.progressPanel != null){
            this.progressPanel.updateLog(evt);
        }
    
public static voidmain(java.lang.String[] args)
Starts the application.

param
args an array of command-line arguments

        // Insert code to start the application here.
        try{
            MainFrame wiz = new MainFrame(new CommonInfoModel());
            wiz.show();
        }catch(java.lang.Throwable th){
            logger.severe(th.getMessage());
        }
    
public voidprocessBackAction()

        if(currentNavigationPanel == PROGRESS_PANEL){
            this.currentNavigationPanel = CERTIFICATE_PANEL ;
            CSH.setHelpIDString(gethelpButton(),"WIZARD_CERT");
        }else if(currentNavigationPanel == CERTIFICATE_PANEL){
            this.currentNavigationPanel = DETAILS_COLLECTION_PANEL ;
            CSH.setHelpIDString(gethelpButton(),"WIZARD_FIRST");
        }else if(currentNavigationPanel == CLUSTER_DETAILS_PANEL){
            if(commonInfoModel.getCertificateConversionFlag()){
                this.currentNavigationPanel = CERTIFICATE_PANEL;
                CSH.setHelpIDString(gethelpButton(),"WIZARD_CERT");
            }else{
                this.currentNavigationPanel = DETAILS_COLLECTION_PANEL ;
                CSH.setHelpIDString(gethelpButton(),"WIZARD_FIRST");
            }
        }else if(currentNavigationPanel == DETAILS_COLLECTION_PANEL){
            //
        }
        this.setCurrentNavigationPanel();
    
private voidprocessCancelAction()

        int option = javax.swing.JOptionPane.showConfirmDialog(this,
        stringManager.getString("upgrade.gui.mainframe.exitMessage"),
        stringManager.getString("upgrade.gui.mainframe.exitMessageTitle"),
        javax.swing.JOptionPane.YES_NO_OPTION,
        javax.swing.JOptionPane.QUESTION_MESSAGE);
        if (option == javax.swing.JOptionPane.NO_OPTION) {
            return;
        }
        logger.info("Before Recover Call");
        // START CR 6348866
        commonInfoModel.recover();       
        // END CR 6348866
        DialogEvent de = new DialogEvent(this, DialogEvent.CANCEL_ACTION);
        for(int i=0 ; i<this.dialogListeners.size(); i++){
            ((DialogListener)dialogListeners.elementAt(i)).dialogProcessed(de);
        }
        this.dispose();
    
public voidprocessHelpAction()

        /*DialogEvent de = new DialogEvent(this, DialogEvent.HELP_ACTION);
        if(currentNavigationPanel == PROGRESS_PANEL){
            Utils.getHelpBroker().setCurrentID("top");
        }
        else if(currentNavigationPanel == CERTIFICATE_PANEL){
            Utils.getHelpBroker().setCurrentID("WIZARD_CERT");
        }
        else if(currentNavigationPanel == DETAILS_COLLECTION_PANEL){
            Utils.getHelpBroker().setCurrentID("WIZARD_FIRST");
        }
        / *
        for(int i=0 ; i<this.dialogListeners.size(); i++){
            ((DialogListener)dialogListeners.elementAt(i)).dialogProcessed(de);
        }*/
    
public voidprocessNextAction()

        DialogEvent de = null;
        if(getnextButton().getActionCommand().equals("finish")){
            de = new DialogEvent(this, DialogEvent.FINISH_ACTION);
            this.dispose();
        }else if(currentNavigationPanel == DETAILS_COLLECTION_PANEL){
            //Validate inputs
            if(!this.validateInputs()) 
                return;
            
            //Set inputs in commonInfoModel
            String sourceDirPath = dataCollectionPanel.getSourceDirectoryPath();			
            String targetDirPath = dataCollectionPanel.getDestinationDirectoryPath();			
            String userName = dataCollectionPanel.getAdminUserName();
            String adminPasswd = dataCollectionPanel.getAdminPassword();
            String masterPwd = null;			
            boolean isUpgradeCertSelected = dataCollectionPanel.isUpgradeCertificatesSelected();
			
            commonInfoModel.setSourceInstallDir(sourceDirPath);
            commonInfoModel.setTargetDomainRoot(targetDirPath);
            commonInfoModel.setAdminUserName(userName);
            commonInfoModel.setAdminPassword(adminPasswd);
            commonInfoModel.setCertificateConversionFlag(isUpgradeCertSelected);
            
			// cr6585938  Both EE and PE require a masterpassword
			// EE's is provided by the user.  PE's is an internal
			// default value.
            if(!UpgradeConstants.EDITION_PE.equals(commonInfoModel.getSourceEdition())){
                //- The user must provide the master password 
				masterPwd = dataCollectionPanel.getMasterPassword(); 			
                commonInfoModel.setMasterPassword(masterPwd);
            } else {
				masterPwd = commonInfoModel.getDefaultMasterPassword();
				commonInfoModel.setMasterPassword(masterPwd);
			}

            //Build domain mapping for source
            commonInfoModel.enlistDomainsFromSource();
            
            //Validate admin credentials
            if(!UpgradeUtils.getUpgradeUtils(commonInfoModel).
                    validateUserDetails(userName,adminPasswd,masterPwd)){
                javax.swing.JOptionPane.showMessageDialog(this, 
                        stringManager.getString("upgrade.gui.mainframe.invalidUserDetailsMsg"),
                        stringManager.getString("upgrade.gui.mainframe.invalidUserDetailsTitle"),
                        javax.swing.JOptionPane.ERROR_MESSAGE);
                return;               
            }
            String VersionAndEdition = commonInfoModel.getSourceVersionAndEdition();
            //START - MIGHT REMOVE
            if(isUpgradeCertSelected){
                commonInfoModel.setCertificateConversionFlag(true);
                this.currentNavigationPanel = CERTIFICATE_PANEL;
                CSH.setHelpIDString(gethelpButton(),"WIZARD_CERT");
            }else if(VersionAndEdition != null && VersionAndEdition.equals(UpgradeConstants.VERSION_AS7X_EE)){
                this.currentNavigationPanel = CLUSTER_DETAILS_PANEL;
                CSH.setHelpIDString(gethelpButton(),"WIZARD_CLUSTER");
            }//END _ MIGHT REMOVE
            else{
                de = new DialogEvent(this, DialogEvent.UPGRADE_ACTION);
                this.currentNavigationPanel = PROGRESS_PANEL ;
                CSH.setHelpIDString(gethelpButton(),"WIZARD_RESULT");
            }
            this.setCurrentNavigationPanel();
            
        } 
        
        //MIGHT KNOCK OFF
        else if(currentNavigationPanel == CERTIFICATE_PANEL){
            if(commonInfoModel.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_EE)){
                this.currentNavigationPanel = CLUSTER_DETAILS_PANEL ;
                CSH.setHelpIDString(gethelpButton(),"WIZARD_CLUSTER");
            }else{
                de = new DialogEvent(this, DialogEvent.UPGRADE_ACTION);
                this.currentNavigationPanel = PROGRESS_PANEL ;
                CSH.setHelpIDString(gethelpButton(),"WIZARD_RESULT");
            }
            this.setCurrentNavigationPanel();
        } //MIGHT KNOCK OFF
        else if(currentNavigationPanel == CLUSTER_DETAILS_PANEL){
            // gather data from cluster details panel and save it in common info.
            Vector clusterFileNames = this.clusterDetailsPanel.getClusterFilesTableModel().getClusterFiles();
            // Do error check here.  Check to see whether the entered list of files are valid or not.
            if((clusterFileNames != null) && (!clusterFileNames.isEmpty())){
                if(!commonInfoModel.processClinstnceConfFiles(clusterFileNames)){
                    javax.swing.JOptionPane.showMessageDialog(this, stringManager.getString("upgrade.gui.mainframe.clusterListInvalidMsg"),
                                                          stringManager.getString("upgrade.gui.mainframe.lusterListInvalidTitle"),
                                                          javax.swing.JOptionPane.ERROR_MESSAGE);
                    return;
                }
            }
            de = new DialogEvent(this, DialogEvent.UPGRADE_ACTION);
            this.currentNavigationPanel = PROGRESS_PANEL ;
            this.setCurrentNavigationPanel();
            CSH.setHelpIDString(gethelpButton(),"WIZARD_RESULT");
        }else if(currentNavigationPanel == PROGRESS_PANEL){
            // should be a Finish button now.  Close the upgrade tool
            de = new DialogEvent(this, DialogEvent.FINISH_ACTION);
            this.dispose();
        }
        if(de != null){
            new UpgradeActionThread(dialogListeners, de).start();
        }
    
public voidremoveDialogListener(com.sun.enterprise.tools.upgrade.gui.util.DialogListener listener)

        this.dialogListeners.removeElement(listener);
    
public voidsetCurrentNavigationPanel()

        getnavigationPanel().removeAll();
        this.getJDialogContentPane().invalidate();
        java.awt.GridBagConstraints constraintsPanel = new java.awt.GridBagConstraints();
        constraintsPanel.gridx = 0; constraintsPanel.gridy = 0;
        constraintsPanel.fill = java.awt.GridBagConstraints.BOTH;
        constraintsPanel.weightx = 1.0;
        constraintsPanel.weighty = 1.0;
        if(this.PROGRESS_PANEL == currentNavigationPanel){
            getnavigationPanel().add(getProgressPanel(), constraintsPanel);
            this.setFrameNavigationState(this.UPGRADE_STARTED);
        }else if(this.CERTIFICATE_PANEL == currentNavigationPanel){
            getnavigationPanel().add(getCertificatePanel(), constraintsPanel);
            this.setFrameNavigationState(this.CRTIFICATION_PENDING);
            ((CertificatePanel)getCertificatePanel()).reInitializeAddDomainDialog();
        }else if(this.DETAILS_COLLECTION_PANEL == currentNavigationPanel){
            getnavigationPanel().add(getDataCollectionPanel(), constraintsPanel);
            this.setFrameNavigationState(this.DATA_COLLECTION_PENDING);
        }else if(this.CLUSTER_DETAILS_PANEL == currentNavigationPanel){
            getnavigationPanel().add(getClusterDetailsPanel(), constraintsPanel);
            this.setFrameNavigationState(this.CLUSTER_DETAILS_PENDING);
        }
        this.getJDialogContentPane().validate();
        this.repaint();
    
private voidsetFrameNavigationState(int state)

        if(this.UPGRADE_FINISHED == state){
            getcancelButton().setEnabled(false);
            getnextButton().setEnabled(true);
            getnextButton().setActionCommand("finish");
            getnextButton().setText(stringManager.getString("upgrade.gui.mainframe.finishbutton"));
            getbackButton().setEnabled(false);
        }else if(this.UPGRADE_STARTED == state){
            getnextButton().setEnabled(false);
            getbackButton().setEnabled(false);
        }else if(this.CRTIFICATION_PENDING == state){
            getnextButton().setEnabled(true);
            getbackButton().setEnabled(true);
        }else if(this.CLUSTER_DETAILS_PENDING == state){
            getnextButton().setEnabled(true);
            getbackButton().setEnabled(true);
         }else{
            // Data collection panel is shown at this point
            getcancelButton().setEnabled(true);
            this.setNextButtonStateForDataCollectionPanel();
            getnextButton().setActionCommand("next");
            getbackButton().setEnabled(false);
        }
    
private voidsetNextButtonStateForClusterDetailsPanel()

        if(this.clusterDetailsPanel.getClusterFilesTableModel().getClusterFiles().size() == 0){
            getnextButton().setEnabled(false);
        }else{
            getnextButton().setEnabled(true);
        }
    
private voidsetNextButtonStateForDataCollectionPanel()

        String sourcePath = this.dataCollectionPanel.getSourceDirectoryPath();
        String destPath = this.dataCollectionPanel.getDestinationDirectoryPath();
        String adminUserName = this.dataCollectionPanel.getAdminUserName();
        String adminPassword = this.dataCollectionPanel.getAdminPassword();

        //Set source in commonInfoModel for further processing
        if(UpgradeUtils.getUpgradeUtils(commonInfoModel).isValidSourcePath(sourcePath)) {
            commonInfoModel.clearSourceAndTargetVersions();
            commonInfoModel.setSourceInstallDir(sourcePath);
        }

        //Enable/Disable Next button at any point after inputs
        if(UpgradeConstants.EDITION_PE.equals(commonInfoModel.getSourceEdition())){
            //Admin credential changes. Added for CR 6454007
            if((sourcePath == null) || (destPath == null) || 
                    (adminUserName == null) || (adminPassword == null) || 
                    ("".equals(adminUserName)) || ("".equals(adminPassword)) || 
                    ("".equals(sourcePath)) || ("".equals(destPath))){
                getnextButton().setEnabled(false);
            }else{
                getnextButton().setEnabled(true);
            }
        }else{
            //Admin credential changes. Added for CR 6454007
            String masterPassword = this.dataCollectionPanel.getMasterPassword();

            if((sourcePath == null) || (destPath == null) || 
                    (adminUserName == null) || (adminPassword == null) || 
                    (masterPassword == null) || 
                    ("".equals(adminUserName)) || ("".equals(adminPassword)) || 
                    ("".equals(sourcePath)) || ("".equals(destPath)) || 
                    ("".equals(masterPassword))){
                getnextButton().setEnabled(false);
            }else{
                getnextButton().setEnabled(true);
            }
        }
    
public voidupgradeProcessUpdate(UpgradeUpdateEvent evt)

        if(this.progressPanel != null){
            this.progressPanel.updateProgress(evt);
            if(evt.getProgressState() == 100){
                this.setFrameNavigationState(this.UPGRADE_FINISHED);
            }
        }
    
private booleanvalidateInputs()
Method to validate source and target directory inputs on the GUI panel Also checks whether the upgrade path is supported or not.

        
        //Collect inputs from the GUI panel
        String sourceDir = dataCollectionPanel.getSourceDirectoryPath();
        String destDir = dataCollectionPanel.getDestinationDirectoryPath();
        UpgradeUtils upgrUtils = UpgradeUtils.getUpgradeUtils(commonInfoModel);            
        
        //Validate the source directory input
        if(!upgrUtils.isValidSourcePath(sourceDir)){
            // pop up error message
            javax.swing.JOptionPane.showMessageDialog(this, 
                    stringManager.getString("upgrade.gui.mainframe.invalidSourceMsg"), 
                    stringManager.getString("upgrade.gui.mainframe.invalidSourceTitle"), 
                    javax.swing.JOptionPane.ERROR_MESSAGE);
            return false;
        }

        //Validate the target directory input
        // START CR 6461833 
        if(!upgrUtils.isValidTargetPath(destDir)){
            // pop up error message
            javax.swing.JOptionPane.showMessageDialog(this, 
                    stringManager.getString("upgrade.gui.mainframe.invalidTargetMsg"),
                    stringManager.getString("upgrade.gui.mainframe.invalidTargetTitle"),
                    javax.swing.JOptionPane.ERROR_MESSAGE);
            return false;
        }
        // END CR 6461833
        
        //Inputs are valid. Set values in commonInfoModel
        String targetInstallDir = System.getProperty("com.sun.aas.installRoot");
        commonInfoModel.setSourceInstallDir(sourceDir);
        commonInfoModel.setTargetInstallDir(targetInstallDir);
        
        //Check if the upgrade path is supported
        if(!commonInfoModel.isUpgradeSupported()){
            //Fix for CR 6376765
            javax.swing.JOptionPane.showMessageDialog(this, 
                    stringManager.getString("upgrade.gui.mainframe.versionNotSupportedMsg"),
                    stringManager.getString("upgrade.gui.mainframe.versionNotSupportedTitle"),
                    javax.swing.JOptionPane.ERROR_MESSAGE);
            commonInfoModel.clearSourceAndTargetVersions();
            return false;
        }//start CR 6429014
        else {
            //7X specific code - MIGHT KNOCK OFF    
            String src = (String) sourceDir;
            String targ = (String) targetInstallDir;
            if(commonInfoModel.getSourceVersion().equals(UpgradeConstants.VERSION_7X)) {
                if(targ != null && !targ.equals("") && src!= null && !src.equals("")) {
                    if(targ.equals(src)) {
                        //Fix for CR 6376765
                        javax.swing.JOptionPane.showMessageDialog(this,
                                stringManager.getString("upgrade.gui.mainframe.versionNotSupportedMsg"),
                                stringManager.getString("upgrade.gui.mainframe.versionNotSupportedTitle"),
                                javax.swing.JOptionPane.ERROR_MESSAGE);
                        //End - Fix 6376765
                        commonInfoModel.clearSourceAndTargetVersions();
                        return false;
                    }
                }
            }
            //End - 7X
        }
        //end CR 6429014

        commonInfoModel.clearSourceAndTargetVersions();
        return true;