Examples of DomainConfig


Examples of com.sun.enterprise.admin.servermgmt.DomainConfig

        if (type.equals(DAS_TYPE))
        {
            String domainName = typeDir.getName();
            String domainRoot = typeDir.getParent();
            try {
                DomainConfig dc = new DomainConfig(domainName, domainRoot);
                RepositoryManager rm = new RepositoryManager();
                rm.checkRepository(dc, true);
            }catch (RepositoryException re){
                throw new CommandException(re.getLocalizedMessage());
            }
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.DomainConfig

        validateOptions();

        String[] domainsList = null;
        try
        {
            DomainConfig domainConfig = new DomainConfig(null, getDomainsRoot());
            DomainsManager manager = getFeatureFactory().getDomainsManager();
            domainsList = manager.listDomains(domainConfig);
        }
        catch(Exception e)
        {
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.DomainConfig

    {  
        setLoggerLevel();
        String domainName = getDomainName();        
        String agentName = null;       
        try {
            DomainConfig config = getDomainConfig(domainName);                        
            DomainsManager mgr = getFeatureFactory().getDomainsManager();   
            //domain validation upfront (i.e. before we prompt)                     
            mgr.validateDomain(config, true);
        } catch (Exception ex) {
            //any exception validating the domain name, and we will
            //assume that a node agent has been specified
            domainName = null;
        }
        try {                
            if (domainName != null) { 
                /**
                com.sun.enterprise.cli.commands.ChangeMasterPasswordCommand cmd =
                    new com.sun.enterprise.cli.commands.ChangeMasterPasswordCommand();
                cmd.changeMasterPassword(domainName);            
                 ***/
                //WARNING!!! The code below is duplicated in admin-cli ChangeMasterPasswordCommand.java.
                //I tried to share the code as illustrated above, but ran into issues.
                DomainConfig config = getDomainConfig(domainName);                        
                DomainsManager mgr = getFeatureFactory().getDomainsManager();   
                //domain validation upfront (i.e. before we prompt)                     
                mgr.validateDomain(config, true);

                masterPassword = getMasterPassword(new RepositoryManager(), config);
                //getPassword(optionName, allowedOnCommandLine, readPrefsFile, readPasswordOptionFromPrefs,
                //readMasterPasswordFile, mgr, config,
                //promptUser, confirm, validate)
                config.put(DomainConfig.K_MASTER_PASSWORD, masterPassword);
                mgr.validateMasterPassword(config);
               
                newMasterPassword = getNewMasterPassword();
                validateOptions();           
                Boolean saveMasterPassword = getSaveMasterPassword(null);       
                config.put(DomainConfig.K_NEW_MASTER_PASSWORD, newMasterPassword);
                config.put(DomainConfig.K_SAVE_MASTER_PASSWORD, saveMasterPassword);
                mgr.changeMasterPassword(config);   
                CLILogger.getInstance().printDetailMessage(_strMgr.getString("DomainPasswordChanged",
                    new Object[] {domainName}));
                //END WARNING!!!
            } else {
                agentName = getAgentName();           
                AgentConfig config = new AgentConfig(agentName,
                    getAgentPath());          
                AgentManager manager = getAgentManager(config);
                //Ensure that the node agent exists
                manager.validateNodeAgent(config, true);
                masterPassword = getMasterPassword(manager, config);

                config.put(AgentConfig.K_MASTER_PASSWORD, masterPassword);
                manager.validateMasterPassword(config, true);

                //getPassword(optionName, allowedOnCommandLine, readPrefsFile, readPasswordOptionFromPrefs,
                //readMasterPasswordFile, mgr, config,
                //promptUser, confirm, validate)
                newMasterPassword = getNewMasterPassword();
                Boolean saveMasterPassword = getSaveMasterPassword(null);               
                config.put(AgentConfig.K_NEW_MASTER_PASSWORD, newMasterPassword);
                config.put(AgentConfig.K_SAVE_MASTER_PASSWORD, saveMasterPassword);
                manager.changeMasterPassword(config);    
                CLILogger.getInstance().printDetailMessage(_strMgr.getString("NodeAgentPasswordChanged",
                    new Object[] {agentName}));
            }
        } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.