org.ow2.jasmine.jadort.service.action.modProxyBalancer
Class ModProxyBalancer

java.lang.Object
  extended by org.ow2.jasmine.jadort.service.action.modProxyBalancer.ModProxyBalancer

public class ModProxyBalancer
extends Object

The mod_proxy_balancer manager.

Author:
Malek Chahine, Remy Bresson, S. Ali Tokmen

Field Summary
 List<Balancer> balancers
           
 String nonce
           
 
Constructor Summary
ModProxyBalancer(String url)
          Constructor.
ModProxyBalancer(String url, String login, String password)
          Constructor.
 
Method Summary
 void activateWorker(String balancerName, String workerUrl)
          Activate a worker
 void deactivateWorker(String balancerName, String workerUrl)
          Deactivate a worker
 List<Balancer> getBalancers()
           
 String getLogin()
           
 String getPassword()
           
 String getUrl()
           
protected  String openConnection()
          open the http connection and send the request to ModProxyBalancer url
protected  String openConnection(String param)
          open the http connection and send the request to ModProxyBalancer url
 void parseAndUpdateModProxyBalancer(String response)
          parse the html response and update the modProxyBalacncer Info
 void setLogin(String login)
           
 void setPassword(String password)
           
 void setUrl(String url)
           
protected  void updateBalancerInfo()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

balancers

public List<Balancer> balancers

nonce

public String nonce
Constructor Detail

ModProxyBalancer

public ModProxyBalancer(String url,
                        String login,
                        String password)
Constructor.

Parameters:
url - : mod_proxy_balancer manager url
login - : login of mod_proxy_balancer manager web application
password - : password of mod_proxy_balancer manager web application

ModProxyBalancer

public ModProxyBalancer(String url)
Constructor.

Parameters:
url - : mod_proxy_balancer manager url
Method Detail

updateBalancerInfo

protected void updateBalancerInfo()
                           throws Exception
Throws:
Exception

parseAndUpdateModProxyBalancer

public void parseAndUpdateModProxyBalancer(String response)
parse the html response and update the modProxyBalacncer Info

Parameters:
response - : the html response to be parsed

openConnection

protected String openConnection()
                         throws Exception
open the http connection and send the request to ModProxyBalancer url

Returns:
the html content of the requested page
Throws:
Exception

openConnection

protected String openConnection(String param)
                         throws Exception
open the http connection and send the request to ModProxyBalancer url

Parameters:
param - : parameters that will be passed to the url
Returns:
the html content of the requested page
Throws:
Exception

getLogin

public String getLogin()

setLogin

public void setLogin(String login)

getPassword

public String getPassword()

setPassword

public void setPassword(String password)

getUrl

public String getUrl()

setUrl

public void setUrl(String url)

getBalancers

public List<Balancer> getBalancers()
                            throws Exception
Throws:
Exception

activateWorker

public void activateWorker(String balancerName,
                           String workerUrl)
                    throws Exception
Activate a worker

Parameters:
balancerName - : the name of the target balancer
workerUrl - : the url of the target worker that will be activated
Throws:
Exception

deactivateWorker

public void deactivateWorker(String balancerName,
                             String workerUrl)
                      throws Exception
Deactivate a worker

Parameters:
balancerName - : the name of the target balancer
workerUrl - : the url of the target worker that will be deactivated
Throws:
Exception


Copyright © 2012 OW2 Consortium. All Rights Reserved.