From: <jt...@hy...> - 2008-03-12 02:10:57
|
Author: jtravis Date: 2008-03-11 19:10:53 -0700 (Tue, 11 Mar 2008) New Revision: 8180 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=8180 Modified: branches/HQ_3_2/src/org/hyperic/hq/hqu/rendit_sys/helpers/ResourceHelper.groovy branches/HQ_3_2/src/org/hyperic/hq/hqu/rendit_sys/metaclass/ResourceCategory.groovy Log: Add documentation to various Resource methods Modified: branches/HQ_3_2/src/org/hyperic/hq/hqu/rendit_sys/helpers/ResourceHelper.groovy =================================================================== --- branches/HQ_3_2/src/org/hyperic/hq/hqu/rendit_sys/helpers/ResourceHelper.groovy 2008-03-11 19:47:17 UTC (rev 8179) +++ branches/HQ_3_2/src/org/hyperic/hq/hqu/rendit_sys/helpers/ResourceHelper.groovy 2008-03-12 02:10:53 UTC (rev 8180) @@ -244,14 +244,27 @@ rman.findRootResource() } + /** + * Find all resource groups: + * + * Returns a list of {@link ResourceGroup}s + */ List findAllGroups() { groupMan.getAllResourceGroups() } - + + /** + * Find a prototype by name. + */ Resource findResourcePrototype(String name) { rman.findResourcePrototypeByName(name) } + /** + * Find all prototypes of platforms, servers, and services + * + * @return a list of {@link Resource}s which are prototypes. + */ List findAllAppdefPrototypes() { rman.findAllAppdefPrototypes() } Modified: branches/HQ_3_2/src/org/hyperic/hq/hqu/rendit_sys/metaclass/ResourceCategory.groovy =================================================================== --- branches/HQ_3_2/src/org/hyperic/hq/hqu/rendit_sys/metaclass/ResourceCategory.groovy 2008-03-11 19:47:17 UTC (rev 8179) +++ branches/HQ_3_2/src/org/hyperic/hq/hqu/rendit_sys/metaclass/ResourceCategory.groovy 2008-03-12 02:10:53 UTC (rev 8180) @@ -106,7 +106,7 @@ def ent = getEntityID(r) ent.isPlatform() || ent.isServer() || ent.isService() } - + static Collection getDesignatedMetrics(Resource r) { dman.findDesignatedMeasurements(r.entityID) } @@ -196,13 +196,18 @@ cfg.populate() cfg.entries } - + + /** + * @see ResourceConfig + */ static void setConfig(Resource r, Map m, AuthzSubject subject) { (new ResourceConfig(r)).setProperties(m, subject) } /** * Get all the children of a resource, viewable by the passed user. + * + * @return a list of {@link Resource}s */ static Collection getViewableChildren(Resource r, AuthzSubject user) { def res = [] @@ -226,6 +231,11 @@ res } + /** + * Convoluted way to get the children from the root resource. + * + * @deprecated + */ static List getChildren(Resource r, Map args) { if (r.isRoot()) { // Need subsystem argument |