backend/rhn-conf/rhn.conf | 10 - java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 69 ++++++++++ 2 files changed, 74 insertions(+), 5 deletions(-)
New commits: commit 269357145c6708501f9e4ef75495abb9ee79a21e Author: Colin Coe colin.coe@gmail.com Date: Mon Oct 25 14:34:36 2010 +0800
Implement API calls for System Currency
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java index a19871f..dee1697 100644 --- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java +++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java @@ -75,6 +75,7 @@ import com.redhat.rhn.frontend.dto.ActivationKeyDto; import com.redhat.rhn.frontend.dto.ErrataOverview; import com.redhat.rhn.frontend.dto.EssentialChannelDto; import com.redhat.rhn.frontend.dto.ServerPath; +import com.redhat.rhn.frontend.dto.SystemCurrency; import com.redhat.rhn.frontend.dto.SystemOverview; import com.redhat.rhn.frontend.events.SsmDeleteServersEvent; import com.redhat.rhn.frontend.xmlrpc.BaseHandler; @@ -4683,4 +4684,72 @@ public class SystemHandler extends BaseHandler { convertToFlex(serverIds, cf.getId(), user); }
+ /** + * Get the System Currency score multipliers + * @param sessionKey session + * @return the score multipliers used by the System Currency page + * + * @xmlrpc.doc Get the System Currency score multipliers + * @xmlrpc.param #param("string", "sessionKey") + * @xmlrpc.returntype Map of score multipliers + */ + public Map getSystemCurrencyMultipliers(String sessionKey) { + Map multipliers = new HashMap(); + multipliers.put("scCrit", ConfigDefaults.get().getSCCrit()); + multipliers.put("scImp", ConfigDefaults.get().getSCImp()); + multipliers.put("scMod", ConfigDefaults.get().getSCMod()); + multipliers.put("scLow", ConfigDefaults.get().getSCLow()); + multipliers.put("scBug", ConfigDefaults.get().getSCBug()); + multipliers.put("scEnh", ConfigDefaults.get().getSCEnh()); + return multipliers; + } + + /** + * Get System Currency scores for all servers the user has access to + * @param sessionKey session + * @return List of user visible systems and a breakdown of the security, + * bug fix and enhancement errata counts plus a score based on the default + * system currency multipliers. + * + * @xmlrpc.doc Get the System Currency score multipliers + * @xmlrpc.param #param("string", "sessionKey") + * @xmlrpc.returntype + * #array() + * #struct("system currency") + * #prop("int", "sid") + * #prop("int", "critical security errata count") + * #prop("int", "important security errata count") + * #prop("int", "moderate security errata count") + * #prop("int", "low security errata count") + * #prop("int", "bug fix errata count") + * #prop("int", "enhancement errata count") + * #prop("int", "system currency score") + * #struct_end() + * #array_end() + */ + public List getSystemCurrencyScores(String sessionKey) { + User user = getLoggedInUser(sessionKey); + DataResult<SystemCurrency> dr = SystemManager.systemCurrencyList(user, null); + List l = new ArrayList(); + for (Iterator it = dr.iterator(); it.hasNext();) { + Map m = new HashMap(); + SystemCurrency s = (SystemCurrency) it.next(); + m.put("sid", s.getId()); + m.put("crit", s.getCritical()); + m.put("imp", s.getImportant()); + m.put("mod", s.getModerate()); + m.put("low", s.getLow()); + m.put("bug", s.getBug()); + m.put("enh", s.getEnhancement()); + m.put("score", s.getCritical() * ConfigDefaults.get().getSCCrit() + + s.getImportant() * ConfigDefaults.get().getSCImp() + + s.getModerate() * ConfigDefaults.get().getSCMod() + + s.getLow() * ConfigDefaults.get().getSCLow() + + s.getBug() * ConfigDefaults.get().getSCBug() + + s.getEnhancement() * ConfigDefaults.get().getSCEnh()); + l.add(m); + } + + return l; + } }
commit 86371f3831eaf48ef21e93aeba178ca49187ff7f Author: Colin Coe colin.coe@gmail.com Date: Mon Oct 25 18:35:27 2010 +0800
Reset the System Currency multipliers to the original values
diff --git a/backend/rhn-conf/rhn.conf b/backend/rhn-conf/rhn.conf index 624da60..5e563de 100644 --- a/backend/rhn-conf/rhn.conf +++ b/backend/rhn-conf/rhn.conf @@ -13,9 +13,9 @@ log_file = /var/log/rhn/rhn.log
enable_snapshots = 1
-sc.crit = 65536 -sc.imp = 256 -sc.mod = 64 -sc.low = 16 -sc.bug = 4 +sc.crit = 32 +sc.imp = 16 +sc.mod = 8 +sc.low = 4 +sc.bug = 2 sc.enh = 1
spacewalk-commits@lists.fedorahosted.org