FileDocCategorySizeDatePackage
ARG_passwordfile.javaAPI DocGlassfish v2 API3919Fri May 04 22:35:06 BST 2007com.sun.enterprise.tools.upgrade.common.arguments

ARG_passwordfile

public class ARG_passwordfile extends ArgumentHandler
author
Hans Hrasna

Fields Summary
Constructors Summary
public ARG_passwordfile(ParsedArgument pa)
Creates a new instance of ARG_passwordfile

        super(pa);
        String msg = sm.getString("enterprise.tools.upgrade.cli.argument_missing","--passwordfile+/-f");
        if (parameters.isEmpty()) {
            helpUsage(msg);
            System.exit(1);
        }
        String pwdFile = (String)parameters.firstElement();
        commonInfo.setPasswordsFromFile(pwdFile);
        interactiveMap.put(ArgsParser.ADMINUSER, commonInfo.getAdminUserName());
        interactiveMap.put(ArgsParser.MASTERPASSWORD, commonInfo.getMasterPassword());
        interactiveMap.put(ArgsParser.ADMINPASSWORD,commonInfo.getAdminPassword());
        String adminUser = commonInfo.getAdminUserName();
        String adminPassword = commonInfo.getAdminPassword();
        String masterPassword = null;
        String sourceEdition = commonInfo.getSourceEdition();
        if(sourceEdition != null && !("").equals(sourceEdition)) {
            if(!UpgradeConstants.EDITION_PE.equals(sourceEdition)) {
                masterPassword = commonInfo.getMasterPassword();
            }
        }
        if(!UpgradeUtils.getUpgradeUtils(commonInfo).validateUserDetails(adminUser,adminPassword,masterPassword)) {
            if(UpgradeConstants.EDITION_PE.equals(sourceEdition)){
                _logger.severe(sm.getString("enterprise.tools.upgrade.cli.wrong_adminuser_or_adminpassword"));
            } else {
                _logger.severe(sm.getString("enterprise.tools.upgrade.cli.wrong_adminuser_or_adminpassword_or_masterpassword"));
            }
            System.exit(1);
        }
    
Methods Summary