Package com.sun.appserv.management

Examples of com.sun.appserv.management.DomainRoot


        final String target = getOption(TARGET_OPTION);
        try
        {
            MBeanServerConnection mbsc = getMBeanServerConnection(getHost(), getPort(),
                                                                  getUser(), getPassword());
            DomainRoot domainRoot = ProxyFactory.getInstance(mbsc).getDomainRoot();

            LBConfigHelper lbconfigHelper = new LBConfigHelper(domainRoot);
            lbconfigHelper.createLoadBalancer(lbName, target, getLBParams(),
                                                getLBProperties());
            //Now configure the weights for the target cluster
            final boolean isCluster =
                domainRoot.getDomainConfig().getClusterConfigMap().keySet().contains(target);
            if ( ! isCluster )
            {
                //display warning and continue
                _strMgr.getString("WeightCannotApplyToNonCluster",
                                        new Object[] {target});
            }
            else if (getOption(LBConfigHelper.LB_WEIGHT) != null)
                lbconfigHelper.configureLBWeight(target, instanceWeights);
            //Test the connection if autoapplyenabled is true and
            // display warning if pinging is unsuccesful
            if (autoApplyEnabled)
            {
                if (!domainRoot.getLoadBalancerMap().get(lbName).testConnection())
                    CLILogger.getInstance().printWarning(_strMgr.getString(
                                                        "CouldNotPingLB",
                                                        new Object[] {lbName}));
            }
            CLILogger.getInstance().printDetailMessage(getLocalizedString(
View Full Code Here


        //get the config, if lbname is specified
        if (lbName!=null)
        {
            MBeanServerConnection mbsc = getMBeanServerConnection(getHost(), getPort(),
                                                    getUser(), getPassword());
            DomainRoot domainRoot = ProxyFactory.getInstance(mbsc).getDomainRoot();
            DomainConfig domainConfig = domainRoot.getDomainConfig();
            LoadBalancerConfig loadBalancerConfig =
                    domainConfig.getLoadBalancerConfigMap().get(lbName);
            if (loadBalancerConfig==null){
                throw new CommandException(
                        _strMgr.getString("LoadBalancerConfigNotDefined",
View Full Code Here

       
        try
        {
            MBeanServerConnection mbsc = getMBeanServerConnection(getHost(), getPort(),
                                                                  getUser(), getPassword());
            DomainRoot domainRoot = ProxyFactory.getInstance(mbsc).getDomainRoot();
            LBConfigHelper lbconfigHelper = new LBConfigHelper(domainRoot);
            lbconfigHelper.removeLBRef(lbName, configName, target, force);
            CLILogger.getInstance().printDetailMessage(getLocalizedString(
                   "CommandSuccessful",
                   new Object[] {name}));
View Full Code Here

        checkConfigAndLBNameOptions(configName, lbName);
        try
        {
            MBeanServerConnection mbsc = getMBeanServerConnection(getHost(), getPort(),
                                                    getUser(), getPassword());
            DomainRoot domainRoot = ProxyFactory.getInstance(mbsc).getDomainRoot();
            LBConfigHelper lbconfigHelper = new LBConfigHelper(domainRoot);
            lbconfigHelper.createLBRef(lbName, configName, target, mOptions);
            //Now configure the weights for the target cluster
            final boolean isCluster =
                domainRoot.getDomainConfig().getClusterConfigMap().keySet().contains(target);
            if ( ! isCluster )
            {
                //display warning and continue
                CLILogger.getInstance().printWarning(
                        _strMgr.getString("WeightCannotApplyToNonCluster",
View Full Code Here

        {
            MBeanServerConnection mbsc = getMBeanServerConnection(getHost(), getPort(),
                                                                  getUser(), getPassword());
            String lbName = (String) getOperands().get(0);

            DomainRoot domainRoot = ProxyFactory.getInstance(mbsc).getDomainRoot();

            LBConfigHelper lbconfigHelper = new LBConfigHelper(domainRoot);
            lbconfigHelper.removeLoadbalancer(lbName);
            CLILogger.getInstance().printDetailMessage(getLocalizedString(
                   "CommandSuccessful",
View Full Code Here

TOP

Related Classes of com.sun.appserv.management.DomainRoot

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.