Package com.sun.enterprise.admin.servermgmt

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


        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();           
View Full Code Here


    {
        String domainName = null;
        try {
            domainName = getDomainName();
            DomainConfig config = getDomainConfig(domainName);
            DomainsManager mgr = getFeatureFactory().getDomainsManager();
            InstancesManager im = mgr.getInstancesManager(config);
            int state = im.getInstanceStatus();
            boolean printMessage = (state == Status.kInstanceNotRunningCode);
            super.runCommand();
  
            if (printMessage) {
View Full Code Here

        try {
            File domainsDirFile = ok(domainDirParam)
                    ? new File(domainDirParam) : DomainDirs.getDefaultDomainsDir();

            DomainConfig domainConfig = new DomainConfig(null, domainsDirFile.getAbsolutePath());
            DomainsManager manager = new PEDomainsManager();
            String[] domainsList = manager.listDomains(domainConfig);
            programOpts.setInteractive(false)// no prompting for passwords
            if (domainsList.length > 0) {
                if (longOpt) {
                    String headings[] = {"DOMAIN", "ADMIN_HOST", "ADMIN_PORT", "RUNNING", "RESTART_REQUIRED"};
                    ColumnFormatter cf = header ? new ColumnFormatter(headings) :
View Full Code Here

        try {
            File domainsDirFile = ok(domainDirParam)
                    ? new File(domainDirParam) : DomainDirs.getDefaultDomainsDir();

            DomainConfig domainConfig = new DomainConfig(null, domainsDirFile.getAbsolutePath());
            DomainsManager manager = new PEDomainsManager();
            String[] domainsList = manager.listDomains(domainConfig);
            programOpts.setInteractive(false)// no prompting for passwords
            if (domainsList.length > 0) {
                for (String dn : domainsList) {
                    String status = getStatus(dn);
                    logger.info(status);
View Full Code Here

        try {
            File domainsDirFile = ok(domainDirParam) ?
                new File(domainDirParam) : DomainDirs.getDefaultDomainsDir();

            DomainConfig domainConfig = new DomainConfig(null, domainsDirFile.getAbsolutePath());
            DomainsManager manager = new PEDomainsManager();
            String[] domainsList = manager.listDomains(domainConfig);
            programOpts.setInteractive(false)// no prompting for passwords
            if (domainsList.length > 0) {
                for (String dn : domainsList) {
                    String status = getStatus(dn);
                    logger.info(strings.get("list.domains.Output", dn, status));
View Full Code Here

    protected int executeCommand()
            throws CommandException, CommandValidationException {

        // domain validation upfront (i.e. before we prompt)
        try {
            DomainsManager manager = new PEDomainsManager();
            DomainConfig config =
                new DomainConfig(domainName, domainDir);
            manager.validateDomain(config, false);
            verifyPortBase();
        } catch (DomainException e) {
            logger.fine(e.getLocalizedMessage());
            throw new CommandException(
                strings.get("CouldNotCreateDomain", domainName), e);
View Full Code Here

        /*
         * We must init the secure admin settings after the key tool options
         * have been set, in case those options override the default CN.
         */
        initSecureAdminSettings(domainConfig);
        DomainsManager manager = new PEDomainsManager();

        manager.createDomain(domainConfig);
        try {
            modifyInitialDomainXml(domainConfig);
        } catch (Exception e) {
            logger.warning(
                            strings.get("CustomizationFailed",e.getMessage()));
View Full Code Here

        try {           
            DomainConfig domainConfig =
                new DomainConfig(getDomainName(), getDomainsDir().getPath());
            checkRunning();
            checkRename();
            DomainsManager manager = new PEDomainsManager();
            manager.deleteDomain(domainConfig);
            // By default, do as what v2 does -- don't delete the entry -
            // might need a revisit (Kedar: 09/16/2009)
            //deleteLoginInfo();
        } catch (Exception e) {
      throw new CommandException(e.getLocalizedMessage());
View Full Code Here

        try {
            File domainsDirFile = ok(domainDirParam)
                    ? new File(domainDirParam) : DomainDirs.getDefaultDomainsDir();

            DomainConfig domainConfig = new DomainConfig(null, domainsDirFile.getAbsolutePath());
            DomainsManager manager = new PEDomainsManager();
            String[] domainsList = manager.listDomains(domainConfig);
            programOpts.setInteractive(false)// no prompting for passwords
            if (domainsList.length > 0) {
                if (longOpt) {
                    String headings[] = {"DOMAIN", "ADMIN_HOST", "ADMIN_PORT", "RUNNING", "RESTART_REQUIRED"};
                    ColumnFormatter cf = header ? new ColumnFormatter(headings) :
View Full Code Here

    protected int executeCommand()
            throws CommandException, CommandValidationException {

        // domain validation upfront (i.e. before we prompt)
        try {
            DomainsManager manager = new PEDomainsManager();
            DomainConfig config =
                    new DomainConfig(domainName, domainDir);
            manager.validateDomain(config, false);
            verifyPortBase();
        }
        catch (DomainException e) {
            logger.fine(e.getLocalizedMessage());
            throw new CommandException(
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.servermgmt.DomainsManager

Copyright © 2018 www.massapicom. 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.