Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.controller.loadbalancer.WeightedBalancer Class Reference

List of all members.

Static Public Member Functions

final String getWeightedXml (HashMap weights)
final String getRaidbXml (HashMap weights, String xmltag)

Detailed Description

To return information, weighted load balancers share the same kind of information on backend configuration.

Author:
Nicolas Modrzyk
Version:
1.0

Definition at line 38 of file WeightedBalancer.java.


Member Function Documentation

final String org.objectweb.cjdbc.controller.loadbalancer.WeightedBalancer.getRaidbXml HashMap  weights,
String  xmltag
[static]
 

Convert raidb weighted balancers into xml because they share common views.

Parameters:
weights hashmap of (name,weight)
xmltag the xml tag to use
Returns:
xml formatted string

Definition at line 71 of file WeightedBalancer.java.

00072   {
00073     StringBuffer info = new StringBuffer();
00074     info.append("<" + xmltag + ">");
00075     info.append(WeightedBalancer.getWeightedXml(weights));
00076     info.append("</" + xmltag + ">");
00077     return info.toString();
00078   }

final String org.objectweb.cjdbc.controller.loadbalancer.WeightedBalancer.getWeightedXml HashMap  weights  )  [static]
 

get different xml tags of the weights in the system.

Parameters:
weights a list ((String)name,(Integer)weight) of weights
Returns:
xml formatted string of weighted backends

Definition at line 46 of file WeightedBalancer.java.

00047   {
00048     if (weights == null)
00049       return "";
00050     StringBuffer info = new StringBuffer();
00051     String nametmp;
00052     for (Iterator iterator = weights.keySet().iterator(); iterator.hasNext();)
00053     {
00054       nametmp = (String) iterator.next();
00055       info
00056           .append("<" + DatabasesXmlTags.ELT_BackendWeight + " "
00057               + DatabasesXmlTags.ATT_name + "=\"" + nametmp + "\" "
00058               + DatabasesXmlTags.ATT_weight + "=\"" + weights.get(nametmp)
00059               + "\"/>");
00060     }
00061     return info.toString();
00062   }


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:03:54 2005 for C-JDBC by  doxygen 1.3.9.1