Examples of LbConfigs


Examples of com.sun.enterprise.config.serverbeans.LbConfigs

     *
     */
     public static String[] getLBsForStandAloneServer(ConfigContext ctx,
                String serverNamethrows ConfigException{
        ArrayList sList = new ArrayList();
        LbConfigs lbs = ((Domain) ctx.getRootConfigBean()).getLbConfigs();

        if (lbs== null) {
            // return, no lb configs
            return null;
        }
        LbConfig[] lbConfigs = lbs.getLbConfig();
        for (int i =0; i < lbConfigs.length; i ++) {
            ServerRef[] sRefs = lbConfigs[i].getServerRef();
            for (int j =0; j < sRefs.length; j++) {
               if (sRefs[j].getRef().equals(serverName) ) {
                    sList.add(lbConfigs[i].getName());    
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.LbConfigs

     *
     */
     public static String[] getLBsForCluster(ConfigContext ctx,
                String clusterNamethrows ConfigException{
        ArrayList sList = new ArrayList();
        LbConfigs lbs = ((Domain) ctx.getRootConfigBean()).getLbConfigs();

        if (lbs== null) {
            // return, no lb configs
            return null;
        }
        LbConfig[] lbConfigs = lbs.getLbConfig();
        for (int i =0; i < lbConfigs.length; i ++) {
            ClusterRef[] cRefs = lbConfigs[i].getClusterRef();
            for (int j =0; j < cRefs.length; j++) {
               if (cRefs[j].getRef().equals(clusterName) ) {
                    sList.add(lbConfigs[i].getName());    
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.LbConfigs

     *
     */
     public static String[] getClustersInLB(ConfigContext ctx,
                String configNamethrows ConfigException{
        ArrayList sList = new ArrayList();
        LbConfigs lbs = ((Domain) ctx.getRootConfigBean()).getLbConfigs();

        if (lbs== null) {
            // return, no lb configs
            return null;
        }
        LbConfig lbConfig = lbs.getLbConfigByName(configName);
        if (lbConfig == null) {
            return null;
        }
        ClusterRef[] cRefs = lbConfig.getClusterRef();
        for (int j =0; j < cRefs.length; j++) {
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.LbConfigs

     *
     */
     public static String[] getServersInLB(ConfigContext ctx,
                String configNamethrows ConfigException{
        ArrayList sList = new ArrayList();
        LbConfigs lbs = ((Domain) ctx.getRootConfigBean()).getLbConfigs();

        if (lbs== null) {
            // return, no lb configs
            return null;
        }
        LbConfig lbConfig = lbs.getLbConfigByName(configName);
        if (lbConfig == null) {
            return null;
        }
        ServerRef[] sRefs = lbConfig.getServerRef();
        for (int j =0; j < sRefs.length; j++) {
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.LbConfigs

   
    protected void setUp() throws ConfigException{
        // create Config context
       
        ConfigContext ctx = ConfigFactory.createConfigContext(URL);
        LbConfigs lbConfigs=((Domain) ctx.getRootConfigBean()).getLbConfigs();

        if (lbConfigs == null) {
             return ;
         }

        LbConfig lbConfig = lbConfigs.getLbConfigByName(LBNAME);

        impl = new LoadbalancerReaderImpl(ctx,lbConfig);

    }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.LbConfigs

   
    protected void setUp() throws ConfigException, LbReaderException{
        // create Config context
       
        ConfigContext ctx = ConfigFactory.createConfigContext(URL);
        LbConfigs lbConfigs=((Domain) ctx.getRootConfigBean()).getLbConfigs();

        if (lbConfigs == null) {
             return ;
         }

        LbConfig lbConfig = lbConfigs.getLbConfigByName(LBNAME);
        ClusterRef cRef = lbConfig.getClusterRefByRef(CLNAME);

        impl = new ClusterReaderImpl(ctx,cRef);

    }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.LbConfigs

    public String[] listLBConfigs(String target) throws MBeanException {

        _logger.log(Level.FINE, "[LBAdminMBean] listLBConfigs called" );

        LbConfigs lbConfigs = getLbConfigs();
        if (lbConfigs == null ) {
            _logger.log(Level.INFO, _sMgr.getString(
                    "http_lb_admin.NoLbConfigs"));
            return null;
        }

        String[] names = null;
        if (target == null) {
            LbConfig[] lbConfigArray = lbConfigs.getLbConfig();
            if (lbConfigArray.length == 0) {
                _logger.log(Level.INFO, _sMgr.getString(
                        "http_lb_admin.NoLbConfigs"));
                return null;
            }
            names = new String [lbConfigArray.length];
            for (int i=0; i < lbConfigArray.length; i++) {
                names[i] = lbConfigArray[i].getName();   
            }
        } else {
            ConfigContext ctx = AdminService.getAdminService().getAdminContext()
                                    .getAdminConfigContext();

            try {
                // target is a cluster
                if (ClusterHelper.isACluster(ctx, target)) {
                    names = getLBConfigsForCluster(target);

                // target is a server
                } else if (ServerHelper.isAServer(ctx, target)) {
                    names = getLBConfigsForServer(target);

                } else {

                    LbConfig lbConfig = lbConfigs.getLbConfigByName(target);

                    // target is a lb config
                    if (lbConfig != null) {
                        String[] clusters = getClustersInLBConfig(target);
                        String[] servers = getServersInLBConfig(target);
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.LbConfigs

    {
        _logger.log(Level.FINE,
            "[LBAdminMBean] getHttpLbConfigObjectName called for configname "
            + name);

        LbConfigs lbConfigs = getLbConfigs();

        if (lbConfigs == null ) {
            _logger.log(Level.FINE,_sMgr.getString(
                    "http_lb_admin.NoLbConfigs"));
            return null;
        }
        LbConfig lbConfig = lbConfigs.getLbConfigByName(name);
        if (lbConfig == null ) {
            _logger.log(Level.FINE,_sMgr.getString(
                    "http_lb_admin.NoLbConfigs"));
            return null;
        }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.LbConfigs

    public void createLBConfig(String configName, String responseTimeout,
            String httpsRouting, String reloadInterval, String monitor,
            String routeCookie, String target, Properties props)
            throws MBeanException
    {
        LbConfigs lbConfigs = null;
        LbConfig newConfig = null;
        try {
            lbConfigs = getLbConfigs();

            newConfig = new LbConfig();
            if (configName == null) {

                if (target == null) {
                    target =
                        SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME;
                }

                // lb config name is derived by adding a suffix to the target
                configName = target + "-http-lb-config";
            }
            newConfig.setName(configName);
            newConfig.setResponseTimeoutInSeconds(
                new Integer(responseTimeout).toString());
            newConfig.setReloadPollIntervalInSeconds(
                new Integer(reloadInterval).toString());
            newConfig.setMonitoringEnabled(
                Boolean.valueOf(monitor).booleanValue());
            newConfig.setRouteCookieEnabled(
                Boolean.valueOf(routeCookie).booleanValue());
            newConfig.setHttpsRouting(
                Boolean.valueOf(httpsRouting).booleanValue());

            ElementProperty [] eProps = getElementProperty(props);
            if (eProps != null) {
                newConfig.setElementProperty(eProps);
            }

            // XXX do I need to use setConfig instead?
            lbConfigs.addLbConfig(newConfig);
       } catch(ConfigException ce) {
            throw new MBeanException(ce);
       }

        try {
            // creates a reference to the target
            if (target != null) {
                createLBRef(target, configName);
            }
            _logger.log(Level.INFO,_sMgr.getString(
                    "http_lb_admin.LbConfigCreated", configName));
        } catch (MBeanException me) {
            // remove lb config if created
            try {
                if ( newConfig != null) { 
                    lbConfigs.removeLbConfig(newConfig);
                }
            } catch (Throwable t) {
            }
            throw me;
        }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.LbConfigs

        return eprops;
    }

    public void deleteLBConfig(String name) throws MBeanException
    {
        LbConfigs lbConfigs = getLbConfigs();
        if (lbConfigs == null ) {
            String msg =  _strMgr.getString("NoLbConfigsElement");
            throw new MBeanException (new ConfigException(msg));
        }
        LbConfig lbConfig = lbConfigs.getLbConfigByName(name);
        if (lbConfig == null) {
            // Nothing to be deleted
            String msg =  _strMgr.getString("InvalidLbConfigName",name);
            throw new MBeanException (new ConfigException(msg));
        }
        if ( (lbConfig.getServerRef() == null ||
             lbConfig.getServerRef().length == 0 ) &&
                ( lbConfig.getClusterRef() == null ||
                    lbConfig.getClusterRef() .length == 0 ) ) {
            lbConfigs.removeLbConfig(lbConfig);
            _logger.log(Level.INFO,_sMgr.getString(
                    "http_lb_admin.LbConfigDeleted", name));
        } else {
            String msg =  _strMgr.getString("LbConfigNotEmpty", name);
            throw new MBeanException (new ConfigException(msg));
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.