Examples of LbConfig


Examples of com.sun.appserv.management.config.LBConfig

     * @return Date timestamp
     */
    public Date getLastExported() {
        final String lbName = getName();
        final String lbConfigName = loadBalancerConfig.getLbConfigName();
        LBConfig lbConfig = getLBConfig(lbConfigName);
        if(lbConfig.existsProperty(LAST_EXPORTED_PROPERTY))
            return new Date(Long.valueOf(lbConfig.getPropertyValue(LAST_EXPORTED_PROPERTY)));
        return null;
    }
View Full Code Here

Examples of com.sun.appserv.management.config.LBConfig

            lbConfigObjName =
                    new ObjectName(LBCONFIG_OBJECT_NAME+lbConfigName);
        } catch ( MalformedObjectNameException e ){
            e.printStackTrace();
        }
        LBConfig lbConfig = getProxy(lbConfigObjName, LBConfig.class);
        return lbConfig;
    }
View Full Code Here

Examples of com.sun.appserv.management.config.LBConfig

    }
   
    private String getLoadBalancerXML(boolean updateTimeStamp) {
        final String lbName = getName();
        final String lbConfigName = loadBalancerConfig.getLbConfigName();
        final LBConfig lbConfig = getLBConfig(lbConfigName);
        if(updateTimeStamp) {
            if(!lbConfig.existsProperty(LAST_EXPORTED_PROPERTY))
                lbConfig.createProperty(LAST_EXPORTED_PROPERTY,String.valueOf(new Date().getTime()));
            else
                lbConfig.setPropertyValue(LAST_EXPORTED_PROPERTY,String.valueOf(new Date().getTime()));
        }

        return lbFactory.getLoadBalancerXML(lbConfigName,lbName);
               
    }
View Full Code Here

Examples of com.sun.appserv.management.config.LBConfig

                lbConfigName = loadbalancerName + LB_CONFIG_SUFFIX + "_" + i;
            }
        }
       
        //create the lb-config
        LBConfig lbConfig = mDomainConfig.createLBConfig(lbConfigName, params);
       
        //get the default values for health-checker
        final Map healthCheckerAttrsMap = mDomainRoot.getDomainConfig().getDefaultAttributeValues(HealthCheckerConfig.J2EE_TYPE);
        final String healthCheckerUrl = (String) healthCheckerAttrsMap.get("url");
        final String healthCheckerInterval = (String) healthCheckerAttrsMap.get("interval-in-seconds");
        final String healthCheckerTimeout = (String) healthCheckerAttrsMap.get("timeout-in-seconds");
       
        if ( targets != null) {
            for (int idx =0; idx < targets.length; idx++) {
                String targetName = targets[idx];
               
                if ( isCluster(targetName)) {
                    //create the cluster-ref
                    ClusterRefConfig clusterRefConfig =
                            lbConfig.createClusterRefConfig(targetName, null);
                    //create the health checker
                    clusterRefConfig.createHealthCheckerConfig(healthCheckerUrl,
                            healthCheckerInterval, healthCheckerTimeout);
                } else if ( isStandaloneServer( targetName)) {
                    //create the server-ref
                    ServerRefConfig serverRefConfig =
                            lbConfig.createServerRefConfig(targetName, null);
                    //create the health checker
                    serverRefConfig.createHealthCheckerConfig(healthCheckerUrl,
                            healthCheckerInterval, healthCheckerTimeout);
                }
            }
View Full Code Here

Examples of com.sun.appserv.management.config.LBConfig

                        target);
                throw new MBeanException(new RuntimeException(msg));
            }
        }
        //create the lb-config
        LBConfig lbConfig = mDomainConfig.createLBConfig(lbConfigName, params);
       
        if(isCluster){
           
            //create the cluster-ref
            ClusterRefConfig clusterRefConfig =
                    lbConfig.createClusterRefConfig(target, lbPolicy,
                        lbPolicyModule);
            //create the health checker
            clusterRefConfig.createHealthCheckerConfig(healthCheckerUrl,
                    healthCheckerInterval, healthCheckerTimeout);
        }else{
            //create the server-ref
            ServerRefConfig serverRefConfig = lbConfig.createServerRefConfig(target,"30",true,true);
            //create the health checker
            serverRefConfig.createHealthCheckerConfig(healthCheckerUrl,
                    healthCheckerInterval, healthCheckerTimeout);
        }
        //lb-enable all the instances in the target
View Full Code Here

Examples of com.sun.appserv.management.config.LBConfig

                    resBundle.getString("LoadBalancerConfigNotDefined"),lbName);
                throw new MBeanException(new RuntimeException(msg));           
            }
            configName = loadBalancerConfig.getLbConfigName();
        }
        LBConfig lbConfig = mDomainConfig.getLBConfigMap().get(configName);
        if(isCluster){
            if (!force){
            //check the lb-enabled flag for all server-refs in this cluster
                Map<String, ServerRefConfig> serverRefConfigMap =
                    mDomainConfig.getClusterConfigMap().get(target).getServerRefConfigMap();
                for (ServerRefConfig serverRefConfig : serverRefConfigMap.values()) {
                    if (serverRefConfig.getLBEnabled()){
                        String msg = formatter.format(
                        resBundle.getString("DisableServer"), target);
                        throw new MBeanException(new RuntimeException(msg));           
                    }
                }
            }
           
            //remove the cluster-ref
            lbConfig.removeClusterRefConfig(target);
        } else {
            if (!force &&
                (lbConfig.getServerRefConfigMap().get(target).getLBEnabled())){
                String msg = formatter.format(
                    resBundle.getString("DisableServer"), target);
                throw new MBeanException(new RuntimeException(msg));           
               
            }
            //remove the server-ref
            lbConfig.removeServerRefConfig(target);
        }

        return null;
    }
View Full Code Here

Examples of com.sun.appserv.management.config.LBConfig

                    resBundle.getString("LoadBalancerConfigNotDefined"),lbName);
                throw new MBeanException(new RuntimeException(msg));           
            }
            configName = loadBalancerConfig.getLbConfigName();
        }
        LBConfig lbConfig = mDomainConfig.getLBConfigMap().get(configName);
        if(!isCluster){
            if((lbPolicy!=null) || (lbPolicyModule!=null)){
                //throw exception
                String msg = formatter.format(resBundle.getString("NotCluster"),
                        target);
                throw new MBeanException(new RuntimeException(msg));
            }
        }
        if(isCluster){
           
            //create the cluster-ref
            ClusterRefConfig clusterRefConfig =
                lbConfig.createClusterRefConfig(target, lbPolicy, lbPolicyModule);
            //create the health checker
            clusterRefConfig.createHealthCheckerConfig(healthCheckerUrl,
                    healthCheckerInterval, healthCheckerTimeout);
        }else{
            //create the server-ref
            ServerRefConfig serverRefConfig = lbConfig.createServerRefConfig(target,"30",true,true);
            //create the health checker
            serverRefConfig.createHealthCheckerConfig(healthCheckerUrl,
                    healthCheckerInterval, healthCheckerTimeout);
        }
        //lb-enable all the instances in the target
View Full Code Here

Examples of com.sun.appserv.management.config.LBConfig

        Map<String,LBConfig> result = new HashMap<String,LBConfig>();
        Map<String,LBConfig> lbConfigMap = mDomainConfig.getLBConfigMap();
       
        if (isCluster) {
            for (String lbConfigName : lbConfigMap.keySet()) {
                LBConfig lbConfig = lbConfigMap.get(lbConfigName);
                Map<String,ClusterRefConfig> lbClusterRefConfigMap =
                    lbConfig.getClusterRefConfigMap();
                for (String clusterRef : lbClusterRefConfigMap.keySet()) {
                    if (clusterRef.equals(targetName)) {
                        result.put(lbConfigName, lbConfig);
                        break;
                    }
                }
            }
        } else if (isStandaloneServer(targetName)) {
         /*its a serverName which means you have to find LBConfigs containing
         1. standalone server references with the same name
         2. clustered server references with the same name */
            for (String lbConfigName : lbConfigMap.keySet()) {
                LBConfig lbConfig = lbConfigMap.get(lbConfigName);
                Map<String,ServerRefConfig> lbServerRefConfigMap =
                    lbConfig.getServerRefConfigMap();
                for (String serverRef : lbServerRefConfigMap.keySet()) {
                    if (serverRef.equals(targetName)) {
                        result.put(lbConfigName, lbConfig);
                        break;
                    }
                }
            }
        } else {//we assume that its a clustered instance name
            for (String lbConfigName : lbConfigMap.keySet()) {
                LBConfig lbConfig = lbConfigMap.get(lbConfigName);
                Map<String,ClusterRefConfig> lbClusterRefConfigMap =
                    lbConfig.getClusterRefConfigMap();
                Map<String,ClusterConfig> clusterConfigMap =
                    mDomainConfig.getClusterConfigMap();
                Map<String,ClusterConfig> relevantClusterConfigMap = new HashMap<String,ClusterConfig>();
                for (String clusterRef : lbClusterRefConfigMap.keySet())
                    relevantClusterConfigMap.put(clusterRef,
View Full Code Here

Examples of com.sun.appserv.management.config.LBConfig

     * @return Map of items, keyed by name.
     * @see com.sun.appserv.management.config.LBConfig
     */
    public Map<String, ServerRefConfig> getServersInLBConfig(String lbConfigName) {
        Map<String,LBConfig> lbconfigs = mDomainConfig.getLBConfigMap();
        LBConfig lbconfig = lbconfigs.get(lbConfigName);
        return lbconfig.getServerRefConfigMap();
    }
View Full Code Here

Examples of com.sun.appserv.management.config.LBConfig

     * @return Map of items, keyed by name.
     * @see com.sun.appserv.management.config.LBConfig
     */
    public Map<String, ClusterRefConfig> getClustersInLBConfig(String lbConfigName) {
        Map<String,LBConfig> lbconfigs = mDomainConfig.getLBConfigMap();
        LBConfig lbconfig = lbconfigs.get(lbConfigName);
        return lbconfig.getClusterRefConfigMap();
    }
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.