|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.appserv.management.helper.LBConfigHelper
public final class LBConfigHelper
Helper class for simplifying load balancer administration.
Field Summary | |
---|---|
static String |
CONFIG
|
static String |
HEALTH_CHECKER_INTERVAL
|
static String |
HEALTH_CHECKER_TIMEOUT
|
static String |
HEALTH_CHECKER_URL
|
static String |
HTTPS_ROUTING
|
static String |
LB_POLICY
|
static String |
LB_POLICY_MODULE
|
static String |
MONITOR
|
static String |
RELOAD_INTERVAL
|
static String |
RESPONSE_TIMEOUT
|
static String |
ROUTE_COOKIE
|
static String |
TARGET
|
Constructor Summary | |
---|---|
LBConfigHelper(DomainRoot domainRoot)
Public constructor |
Method Summary | |
---|---|
String |
configureHTTPLBConfig(String configName,
String target,
Map<String,String> options,
String filePath)
This method supports the configure-http-lb-config CLI command. |
void |
configureLBWeight(String clusterName,
Map instanceVsWeights)
Configures the lb-weight attribute of each instance with the corresponding weight. |
LoadBalancerConfig |
createLoadbalancer(String loadbalancerName,
boolean autoApplyEnabled,
String[] targets,
Map<String,String> params)
Creates a load balancer element ( and the necessary config) |
void |
disableApplication(String target,
String appName,
int timeout)
Disables load balancing for a particular application in a server instance with a quiescing period specififed by the timeout . |
void |
disableServer(String target,
int timeout)
Disables load balancing for a server with a quiescing period specififed by the timeout . |
void |
enableAllApplications(String target)
Enables all user applications in the given target |
void |
enableApplication(String target,
String appName)
Enables load balancing for a particular application in a server instance |
void |
enableServer(String target)
Enables a server for load balancing. |
Map<String,ClusterRefConfig> |
getClustersInLBConfig(String lbConfigName)
Returns a filtered list of cluster references given the name of the load balancer config. |
Map<String,LoadBalancerServerMonitor> |
getInstanceAggregateStats(String serverName)
Returns the stats for an instance. |
Map<String,LoadBalancerServerMonitor> |
getInstanceMonitors(String targetLoadBalancer,
String target,
boolean allTargets)
Gets the Maps of LoadBalancerServerMonitor for specified load balancer and specified target(s). |
Map<String,LoadBalancerServerStats> |
getInstanceStats(String targetLoadBalancer,
String target,
boolean allTargets)
This is a convenience method to fetch the stats for server instance(s) which are either standalone or clustered or both |
Map<String,LoadBalancerContextRootStats> |
getInstanceStats(String targetLoadBalancer,
String contextRoot,
String target,
boolean allTargets)
This is a convenience method to fetch the stats for context roots for an application. |
List<LBConfig> |
getLBConfigsForCluster(String clusterName)
Returns a filtered LBConfig list given the name of the cluster reference |
List<LBConfig> |
getLBConfigsForServer(String serverName)
Returns a filtered LBConfig list given the name of the server reference |
Map<String,LoadBalancerConfig> |
getLoadBalancers(String targetName,
boolean isCluster)
Returns the load balancers loadbalancing a target : standalone instance, clustered instance or a cluster |
Map<String,ServerRefConfig> |
getServersInLBConfig(String lbConfigName)
Returns a filtered list of server references given the name of the load balancer config. |
String[] |
listTargets()
Lists all the standalone server instances and clusters in the domain. |
String[] |
listTargets(String lbName)
Lists all the standalone server instances and clusters in the load balancer. |
void |
removeLoadbalancer(String loadbalancerName)
Deletes a load balancer element ( and the necessary config, if nobody else is using this config) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String RESPONSE_TIMEOUT
public static final String HTTPS_ROUTING
public static final String RELOAD_INTERVAL
public static final String MONITOR
public static final String ROUTE_COOKIE
public static final String HEALTH_CHECKER_URL
public static final String HEALTH_CHECKER_TIMEOUT
public static final String HEALTH_CHECKER_INTERVAL
public static final String TARGET
public static final String CONFIG
public static final String LB_POLICY
public static final String LB_POLICY_MODULE
Constructor Detail |
---|
public LBConfigHelper(DomainRoot domainRoot)
Method Detail |
---|
public List<LBConfig> getLBConfigsForServer(String serverName)
LBConfig
public List<LBConfig> getLBConfigsForCluster(String clusterName)
LBConfig
public Map<String,ServerRefConfig> getServersInLBConfig(String lbConfigName)
LBConfig
public Map<String,ClusterRefConfig> getClustersInLBConfig(String lbConfigName)
LBConfig
public String[] listTargets()
public String[] listTargets(String lbName)
lbName
- Name of the load balancer
public LoadBalancerConfig createLoadbalancer(String loadbalancerName, boolean autoApplyEnabled, String[] targets, Map<String,String> params)
loadbalancerName
- Name of the load balancerautoApplyEnabled
- Auto apply enabled or nottargets
- Standalone server instances or clustersparams
- This is optional, loadbalancer
configuration elemements. The valid
keys are:
LoadBalancerConfig
public void removeLoadbalancer(String loadbalancerName)
public void disableServer(String target, int timeout)
target
- target server whose load balancing has to be disabledtimeout
- quiescing timepublic void enableServer(String target)
target
- target server whose load balancing has to be enabledpublic void disableApplication(String target, String appName, int timeout)
target
- target server where the application has been deployedappName
- application name.timeout
- quiescing timepublic void enableApplication(String target, String appName)
target
- target server where the application has been deployedappName
- application name.public Map<String,LoadBalancerServerStats> getInstanceStats(String targetLoadBalancer, String target, boolean allTargets)
targetLoadBalancer
- Load Balancer for which stats are to be
returnedtarget
- Target cluster name. This is used if
allTargets (next param) is false.allTargets
- list Monitors for all targets.
public Map<String,LoadBalancerContextRootStats> getInstanceStats(String targetLoadBalancer, String contextRoot, String target, boolean allTargets)
targetLoadBalancer
- Load Balancer for which stats are to be
returnedtarget
- Target cluster name. This is used if
allTargets (next param) is false.allTargets
- list Monitors for all targets.
public String configureHTTPLBConfig(String configName, String target, Map<String,String> options, String filePath) throws MBeanException
configName
- the name for the lb-config element that will be createdtarget
- cluster-ref or server-ref parameter of lb-configoptions
- Map of option name and option value. The valid options are
responsetimeout response-timeout-in-seconds attribute of lb-config
httpsrouting https-routing parameter of lb-config
reloadinterval reload-poll-interval-in-seconds parameter of lb-config
monitor monitoring-enabled parameter of lb-config
routecookie route-cookie-enabled parameter of lb-config
filepath the path to the file where loadbalancer.xml will be exported
healthcheckerurl url attribute of health-checker
healthcheckerinterval interval-in-seconds parameter of health-checker
healthcheckertimeout timeout-in-seconds parameter of health-checkerfilePath
- the path to the file where loadbalancer.xml will be exported
MBeanException
- exception indicating the original cause of problmpublic void configureLBWeight(String clusterName, Map instanceVsWeights)
clusterName
- name of the clusterinstanceVsWeights
- Map of instance name Vs weightpublic void enableAllApplications(String target)
target
- The target for which all the applications have to be enabledpublic Map<String,LoadBalancerServerMonitor> getInstanceMonitors(String targetLoadBalancer, String target, boolean allTargets)
targetLoadBalancer
- Load Balancer for which Monitors are to be
returnedtarget
- Target cluster name. This is used if
allTargets (next param) is false.allTargets
- list Monitors for all targets.
public Map<String,LoadBalancerServerMonitor> getInstanceAggregateStats(String serverName)
serverName
- instance name
public Map<String,LoadBalancerConfig> getLoadBalancers(String targetName, boolean isCluster)
targetName
- standalone instance name or
clustered instance name or a cluster nameisCluster
- whether the targetName is a cluster or instance name
|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2006 Sun Microsystems, Inc. All rights reserved.