You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(927) |
Apr
(419) |
May
(352) |
Jun
(431) |
Jul
(463) |
Aug
(345) |
Sep
(304) |
Oct
(596) |
Nov
(466) |
Dec
(414) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(348) |
Feb
(313) |
Mar
(665) |
Apr
(688) |
May
(434) |
Jun
(311) |
Jul
(540) |
Aug
(554) |
Sep
(467) |
Oct
(341) |
Nov
(365) |
Dec
(272) |
2009 |
Jan
(386) |
Feb
(293) |
Mar
(279) |
Apr
(239) |
May
(229) |
Jun
(199) |
Jul
(186) |
Aug
(111) |
Sep
(196) |
Oct
(146) |
Nov
(116) |
Dec
(140) |
2010 |
Jan
(170) |
Feb
(159) |
Mar
(151) |
Apr
(161) |
May
(90) |
Jun
(56) |
Jul
(28) |
Aug
(22) |
Sep
(5) |
Oct
|
Nov
(23) |
Dec
(12) |
2011 |
Jan
(8) |
Feb
(8) |
Mar
(22) |
Apr
(24) |
May
(4) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2012 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <bo...@hy...> - 2009-11-28 08:57:51
|
Author: bob Date: 2009-11-28 00:57:39 -0800 (Sat, 28 Nov 2009) New Revision: 14006 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14006 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1272 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-11-27 10:42:23 UTC (rev 14005) +++ trunk/etc/version.properties 2009-11-28 08:57:39 UTC (rev 14006) @@ -1,3 +1,3 @@ -#Fri Nov 27 00:17:40 PST 2009 +#Sat Nov 28 00:17:57 PST 2009 version=4.3.0 -build=1271 +build=1272 |
From: <bo...@hy...> - 2009-11-27 10:42:36
|
Author: bob Date: 2009-11-27 02:42:23 -0800 (Fri, 27 Nov 2009) New Revision: 14005 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14005 Modified: branches/HQ_4_2/etc/version.properties Log: Release 4.2.1 build #1275 Modified: branches/HQ_4_2/etc/version.properties =================================================================== --- branches/HQ_4_2/etc/version.properties 2009-11-27 08:58:07 UTC (rev 14004) +++ branches/HQ_4_2/etc/version.properties 2009-11-27 10:42:23 UTC (rev 14005) @@ -1,3 +1,3 @@ -#Thu Nov 26 01:30:52 PST 2009 +#Fri Nov 27 01:46:04 PST 2009 version=4.2.1 -build=1274 +build=1275 |
From: <bo...@hy...> - 2009-11-27 08:58:21
|
Author: bob Date: 2009-11-27 00:58:07 -0800 (Fri, 27 Nov 2009) New Revision: 14004 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14004 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1271 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-11-26 10:52:28 UTC (rev 14003) +++ trunk/etc/version.properties 2009-11-27 08:58:07 UTC (rev 14004) @@ -1,3 +1,3 @@ -#Thu Nov 26 00:17:06 PST 2009 +#Fri Nov 27 00:17:40 PST 2009 version=4.3.0 -build=1270 +build=1271 |
From: <bo...@hy...> - 2009-11-26 10:52:42
|
Author: bob Date: 2009-11-26 02:52:28 -0800 (Thu, 26 Nov 2009) New Revision: 14003 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14003 Modified: branches/HQ_4_2/etc/version.properties Log: Release 4.2.1 build #1274 Modified: branches/HQ_4_2/etc/version.properties =================================================================== --- branches/HQ_4_2/etc/version.properties 2009-11-26 08:55:18 UTC (rev 14002) +++ branches/HQ_4_2/etc/version.properties 2009-11-26 10:52:28 UTC (rev 14003) @@ -1,3 +1,3 @@ -#Wed Nov 25 01:36:20 PST 2009 +#Thu Nov 26 01:30:52 PST 2009 version=4.2.1 -build=1273 +build=1274 |
From: <bo...@hy...> - 2009-11-26 08:55:33
|
Author: bob Date: 2009-11-26 00:55:18 -0800 (Thu, 26 Nov 2009) New Revision: 14002 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14002 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1270 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-11-25 10:57:02 UTC (rev 14001) +++ trunk/etc/version.properties 2009-11-26 08:55:18 UTC (rev 14002) @@ -1,3 +1,3 @@ -#Wed Nov 25 00:17:25 PST 2009 +#Thu Nov 26 00:17:06 PST 2009 version=4.3.0 -build=1269 +build=1270 |
From: <bo...@hy...> - 2009-11-25 10:57:15
|
Author: bob Date: 2009-11-25 02:57:02 -0800 (Wed, 25 Nov 2009) New Revision: 14001 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14001 Modified: branches/HQ_4_2/etc/version.properties Log: Release 4.2.1 build #1273 Modified: branches/HQ_4_2/etc/version.properties =================================================================== --- branches/HQ_4_2/etc/version.properties 2009-11-25 08:59:18 UTC (rev 14000) +++ branches/HQ_4_2/etc/version.properties 2009-11-25 10:57:02 UTC (rev 14001) @@ -1,3 +1,3 @@ -#Tue Nov 24 01:14:05 PST 2009 +#Wed Nov 25 01:36:20 PST 2009 version=4.2.1 -build=1272 +build=1273 |
From: <bo...@hy...> - 2009-11-25 08:59:32
|
Author: bob Date: 2009-11-25 00:59:18 -0800 (Wed, 25 Nov 2009) New Revision: 14000 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14000 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1269 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-11-24 11:18:22 UTC (rev 13999) +++ trunk/etc/version.properties 2009-11-25 08:59:18 UTC (rev 14000) @@ -1,3 +1,3 @@ -#Tue Nov 24 00:17:28 PST 2009 +#Wed Nov 25 00:17:25 PST 2009 version=4.3.0 -build=1268 +build=1269 |
From: <no...@gi...> - 2009-11-24 22:50:50
|
Branch: refs/heads/master Home: http://github.com/hyperic/hqapi Commit: cec3a7c03fe5ee015c9a693ae8f4ff96cc846f1d http://github.com/hyperic/hqapi/commit/cec3a7c03fe5ee015c9a693ae8f4ff96cc846f1d Author: Ryan Morgan <rm...@hy...> Date: 2009-11-19 (Thu, 19 Nov 2009) Changed paths: M hqu/hqapi1/plugin.properties Log Message: ----------- Bump to 2.4. Commit: 4c66db5234846cf1c2b01f4fc60ff0da1dda5442 http://github.com/hyperic/hqapi/commit/4c66db5234846cf1c2b01f4fc60ff0da1dda5442 Author: Ryan Morgan <rm...@hy...> Date: 2009-11-19 (Thu, 19 Nov 2009) Changed paths: M hqu/hqapi1/app/ApplicationController.groovy Log Message: ----------- Merge branch 'hqapi-2.x' of github.com:hyperic/hqapi into hqapi-2.x Commit: c3c1284af6adac0512eea20882505ab38a82ce69 http://github.com/hyperic/hqapi/commit/c3c1284af6adac0512eea20882505ab38a82ce69 Author: Ryan Morgan <rm...@hy...> Date: 2009-11-24 (Tue, 24 Nov 2009) Log Message: ----------- Merge branch 'hqapi-2.x' Commit: a0de5d4e285d8940bc5f84b9a3063f2e27535880 http://github.com/hyperic/hqapi/commit/a0de5d4e285d8940bc5f84b9a3063f2e27535880 Author: Ryan Morgan <rm...@hy...> Date: 2009-11-24 (Tue, 24 Nov 2009) Changed paths: M hqu/hqapi1/app/MetricController.groovy M src/org/hyperic/hq/hqapi1/test/Metric_test.java Log Message: ----------- [HHQ-3565] Fix misspelled attribute causing all metrics to show defaultOn=false. Commit: 4f69e4194e97274b0e3361589e34e400ddae3647 http://github.com/hyperic/hqapi/commit/4f69e4194e97274b0e3361589e34e400ddae3647 Author: Ryan Morgan <rm...@hy...> Date: 2009-11-24 (Tue, 24 Nov 2009) Changed paths: M hqu/hqapi1/app/MetricController.groovy M src/org/hyperic/hq/hqapi1/test/Metric_test.java Log Message: ----------- Merge branch 'hqapi-1.0' into hqapi-2.x Commit: 33e1eaf5654f11d7ad7737d218999209e8547e59 http://github.com/hyperic/hqapi/commit/33e1eaf5654f11d7ad7737d218999209e8547e59 Author: Ryan Morgan <rm...@hy...> Date: 2009-11-24 (Tue, 24 Nov 2009) Changed paths: M ChangeLog Log Message: ----------- Update ChangeLog. Commit: 300f78219271fcbabf5c48acaffd31ac20263cc0 http://github.com/hyperic/hqapi/commit/300f78219271fcbabf5c48acaffd31ac20263cc0 Author: Ryan Morgan <rm...@hy...> Date: 2009-11-24 (Tue, 24 Nov 2009) Changed paths: M ChangeLog M hqu/hqapi1/app/MetricController.groovy M src/org/hyperic/hq/hqapi1/test/Metric_test.java Log Message: ----------- Merge ChangeLog |
From: <bo...@hy...> - 2009-11-24 11:18:39
|
Author: bob Date: 2009-11-24 03:18:22 -0800 (Tue, 24 Nov 2009) New Revision: 13999 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13999 Modified: branches/HQ_4_2/etc/version.properties Log: Release 4.2.1 build #1272 Modified: branches/HQ_4_2/etc/version.properties =================================================================== --- branches/HQ_4_2/etc/version.properties 2009-11-24 09:02:01 UTC (rev 13998) +++ branches/HQ_4_2/etc/version.properties 2009-11-24 11:18:22 UTC (rev 13999) @@ -1,3 +1,3 @@ -#Mon Nov 23 01:43:35 PST 2009 +#Tue Nov 24 01:14:05 PST 2009 version=4.2.1 -build=1271 +build=1272 |
From: <bo...@hy...> - 2009-11-24 09:02:16
|
Author: bob Date: 2009-11-24 01:02:01 -0800 (Tue, 24 Nov 2009) New Revision: 13998 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13998 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1268 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-11-23 10:39:34 UTC (rev 13997) +++ trunk/etc/version.properties 2009-11-24 09:02:01 UTC (rev 13998) @@ -1,3 +1,3 @@ -#Mon Nov 23 00:17:16 PST 2009 +#Tue Nov 24 00:17:28 PST 2009 version=4.3.0 -build=1267 +build=1268 |
From: <bo...@hy...> - 2009-11-23 10:39:47
|
Author: bob Date: 2009-11-23 02:39:34 -0800 (Mon, 23 Nov 2009) New Revision: 13997 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13997 Modified: branches/HQ_4_2/etc/version.properties Log: Release 4.2.1 build #1271 Modified: branches/HQ_4_2/etc/version.properties =================================================================== --- branches/HQ_4_2/etc/version.properties 2009-11-23 08:55:46 UTC (rev 13996) +++ branches/HQ_4_2/etc/version.properties 2009-11-23 10:39:34 UTC (rev 13997) @@ -1,3 +1,3 @@ -#Sun Nov 22 01:42:20 PST 2009 +#Mon Nov 23 01:43:35 PST 2009 version=4.2.1 -build=1270 +build=1271 |
From: <bo...@hy...> - 2009-11-23 08:55:59
|
Author: bob Date: 2009-11-23 00:55:46 -0800 (Mon, 23 Nov 2009) New Revision: 13996 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13996 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1267 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-11-22 10:56:01 UTC (rev 13995) +++ trunk/etc/version.properties 2009-11-23 08:55:46 UTC (rev 13996) @@ -1,3 +1,3 @@ -#Sun Nov 22 00:19:43 PST 2009 +#Mon Nov 23 00:17:16 PST 2009 version=4.3.0 -build=1266 +build=1267 |
From: <bo...@hy...> - 2009-11-22 10:56:10
|
Author: bob Date: 2009-11-22 02:56:01 -0800 (Sun, 22 Nov 2009) New Revision: 13995 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13995 Modified: branches/HQ_4_2/etc/version.properties Log: Release 4.2.1 build #1270 Modified: branches/HQ_4_2/etc/version.properties =================================================================== --- branches/HQ_4_2/etc/version.properties 2009-11-22 08:58:53 UTC (rev 13994) +++ branches/HQ_4_2/etc/version.properties 2009-11-22 10:56:01 UTC (rev 13995) @@ -1,3 +1,3 @@ -#Sat Nov 21 01:52:37 PST 2009 +#Sun Nov 22 01:42:20 PST 2009 version=4.2.1 -build=1269 +build=1270 |
From: <bo...@hy...> - 2009-11-22 08:59:03
|
Author: bob Date: 2009-11-22 00:58:53 -0800 (Sun, 22 Nov 2009) New Revision: 13994 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13994 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1266 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-11-21 10:39:04 UTC (rev 13993) +++ trunk/etc/version.properties 2009-11-22 08:58:53 UTC (rev 13994) @@ -1,3 +1,3 @@ -#Sat Nov 21 00:18:57 PST 2009 +#Sun Nov 22 00:19:43 PST 2009 version=4.3.0 -build=1265 +build=1266 |
From: <bo...@hy...> - 2009-11-21 10:39:18
|
Author: bob Date: 2009-11-21 02:39:04 -0800 (Sat, 21 Nov 2009) New Revision: 13993 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13993 Modified: branches/HQ_4_2/etc/version.properties Log: Release 4.2.1 build #1269 Modified: branches/HQ_4_2/etc/version.properties =================================================================== --- branches/HQ_4_2/etc/version.properties 2009-11-21 08:59:28 UTC (rev 13992) +++ branches/HQ_4_2/etc/version.properties 2009-11-21 10:39:04 UTC (rev 13993) @@ -1,3 +1,3 @@ -#Fri Nov 20 01:29:07 PST 2009 +#Sat Nov 21 01:52:37 PST 2009 version=4.2.1 -build=1268 +build=1269 |
From: <bo...@hy...> - 2009-11-21 08:59:39
|
Author: bob Date: 2009-11-21 00:59:28 -0800 (Sat, 21 Nov 2009) New Revision: 13992 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13992 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1265 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-11-21 00:44:10 UTC (rev 13991) +++ trunk/etc/version.properties 2009-11-21 08:59:28 UTC (rev 13992) @@ -1,3 +1,3 @@ -#Fri Nov 20 00:16:24 PST 2009 +#Sat Nov 21 00:18:57 PST 2009 version=4.3.0 -build=1264 +build=1265 |
From: shadley <sig...@hy...> - 2009-11-21 08:54:34
|
Can SIGAR connect to other machines on the network? If so, could someone provide an example of how that would be done? In other words, SIGAR connects to the local machine and gets information, such as cpu and memory usage, about it, so can SIGAR connect to a different machine and get the same information? |
From: <pn...@hy...> - 2009-11-21 00:44:22
|
Author: pnguyen Date: 2009-11-20 16:44:10 -0800 (Fri, 20 Nov 2009) New Revision: 13991 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13991 Modified: trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java Log: [HHQ-3544] Added null pointer check Modified: trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java 2009-11-21 00:42:10 UTC (rev 13990) +++ trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java 2009-11-21 00:44:10 UTC (rev 13991) @@ -534,7 +534,8 @@ // Expect data to be sorted by end time, so that the last value // returned is the final count and the last value - data[IND_CFG_COUNT] = ((java.lang.Number)objs[4]).doubleValue(); + data[IND_CFG_COUNT] = (objs[4] == null) + ? 0 : ((java.lang.Number)objs[4]).doubleValue(); data[IND_LAST_TIME] = ((Double)objs[2]).doubleValue(); data[IND_UP_TIME] += ((Double)objs[5]).doubleValue(); |
From: <pn...@hy...> - 2009-11-21 00:42:23
|
Author: pnguyen Date: 2009-11-20 16:42:10 -0800 (Fri, 20 Nov 2009) New Revision: 13990 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13990 Modified: branches/HQ_4_2/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java Log: [HHQ-3544] Added null pointer check Modified: branches/HQ_4_2/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java 2009-11-20 23:45:56 UTC (rev 13989) +++ branches/HQ_4_2/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java 2009-11-21 00:42:10 UTC (rev 13990) @@ -534,7 +534,8 @@ // Expect data to be sorted by end time, so that the last value // returned is the final count and the last value - data[IND_CFG_COUNT] = ((java.lang.Number)objs[4]).doubleValue(); + data[IND_CFG_COUNT] = (objs[4] == null) + ? 0 : ((java.lang.Number)objs[4]).doubleValue(); data[IND_LAST_TIME] = ((Double)objs[2]).doubleValue(); data[IND_UP_TIME] += ((Double)objs[5]).doubleValue(); |
From: <no...@gi...> - 2009-11-21 00:22:54
|
Branch: refs/heads/master Home: http://github.com/hyperic/hqapi Commit: 4440ed8ec21f999ccbb9e6280cc9dfe72e898eea http://github.com/hyperic/hqapi/commit/4440ed8ec21f999ccbb9e6280cc9dfe72e898eea Author: pnguyen <pnguyen@10.2.0.125> Date: 2009-11-20 (Fri, 20 Nov 2009) Changed paths: M hqu/hqapi1/app/MaintenanceController.groovy M src/org/hyperic/hq/hqapi1/test/MaintenanceTestBase.java M xsd/HQApi1.xsd Log Message: ----------- Add modifiedBy to MaintenanceEvent to improve data validation |
From: <kp...@hy...> - 2009-11-20 23:46:09
|
Author: kparikh Date: 2009-11-20 15:45:56 -0800 (Fri, 20 Nov 2009) New Revision: 13989 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13989 Added: tags/HQ_4_2_0_PATCH1/ Log: Tagging first 4.2.0 patch. Includes following fixes: HHQ-3555 HHQ-3524 HHQ-3513 HHQ-3138 HQ-1916 Copied: tags/HQ_4_2_0_PATCH1 (from rev 13979, branches/HQ_4_2_0_PATCH) |
From: <pn...@hy...> - 2009-11-20 23:41:33
|
Author: pnguyen Date: 2009-11-20 15:41:20 -0800 (Fri, 20 Nov 2009) New Revision: 13988 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13988 Modified: trunk/tools/stresstests/resource_alert_driver.groovy Log: [HQ-1799] Use updated method Modified: trunk/tools/stresstests/resource_alert_driver.groovy =================================================================== --- trunk/tools/stresstests/resource_alert_driver.groovy 2009-11-20 23:41:01 UTC (rev 13987) +++ trunk/tools/stresstests/resource_alert_driver.groovy 2009-11-20 23:41:20 UTC (rev 13988) @@ -218,7 +218,7 @@ def alertDefIds = null if (isResourceType) { - def resourceAlertDefs = adM.one.findChildAlertDefinitions(alertDefId) + def resourceAlertDefs = adM.one.findAlertDefinitionChildren(alertDefId) alertDefIds = resourceAlertDefs.collect {return it.id} } else { alertDefIds = [alertDefId] |
Author: pnguyen Date: 2009-11-20 15:41:01 -0800 (Fri, 20 Nov 2009) New Revision: 13987 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13987 Modified: trunk/src/org/hyperic/hq/authz/shared/AuthzConstants.java trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java trunk/src/org/hyperic/hq/events/Resources.properties trunk/src/org/hyperic/hq/events/server/session/AlertDAO.java trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionDAO.java trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java trunk/src/org/hyperic/hq/events/server/session/AlertManagerEJBImpl.java trunk/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerEJBImpl.java trunk/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerLocalHome.java Log: [HQ-1799] To improve performance, get the last unfixed alerts in batch and update the internal enabled flag in batch Modified: trunk/src/org/hyperic/hq/authz/shared/AuthzConstants.java =================================================================== --- trunk/src/org/hyperic/hq/authz/shared/AuthzConstants.java 2009-11-20 23:18:17 UTC (rev 13986) +++ trunk/src/org/hyperic/hq/authz/shared/AuthzConstants.java 2009-11-20 23:41:01 UTC (rev 13987) @@ -191,6 +191,14 @@ public static final String ResourceEdgeContainmentRelation = "containment"; public static final String ResourceEdgeNetworkRelation = "network"; + // List of alert operations + public static final String[] MANAGE_ALERTS_OPS = + new String[] { + platformOpManageAlerts, + serverOpManageAlerts, + serviceOpManageAlerts + }; + public static boolean isOverlord(Integer subject) { return subject.equals(AuthzConstants.overlordId); } Modified: trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-11-20 23:18:17 UTC (rev 13986) +++ trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-11-20 23:41:01 UTC (rev 13987) @@ -1766,7 +1766,6 @@ PermissionException, SchedulerException { AuthzSubject subject = manager.getSubject(sessionId); - event.setModifiedBy(subject.getName()); return getMaintEvtMgr().schedule(subject, event); } Modified: trunk/src/org/hyperic/hq/events/Resources.properties =================================================================== --- trunk/src/org/hyperic/hq/events/Resources.properties 2009-11-20 23:18:17 UTC (rev 13986) +++ trunk/src/org/hyperic/hq/events/Resources.properties 2009-11-20 23:41:01 UTC (rev 13987) @@ -37,8 +37,8 @@ eventLog.status.debug=Debug maintenance.window=Downtime Window -maintenance.window.state.start=Schedule started. {0} Alerts disabled. Availability measurements for {1} resources disabled. {2} errors occurred. -maintenance.window.state.end=Schedule ended. {0} Alerts enabled. Availability measurements for {1} resources enabled. {2} errors occurred. +maintenance.window.state.start=Started. Scheduled by {3}. {0} Alerts disabled. Availability measurements for {1} resources disabled. {2} errors occurred. +maintenance.window.state.end=Ended. Scheduled by {3}. {0} Alerts enabled. Availability measurements for {1} resources enabled. {2} errors occurred. maintenance.window.state.dead=Schedule skipped. maintenance.window.error.endDate=The end time must be after the start time. maintenance.window.error.illegalState=The downtime schedule is either invalid or has completed. Modified: trunk/src/org/hyperic/hq/events/server/session/AlertDAO.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/AlertDAO.java 2009-11-20 23:18:17 UTC (rev 13986) +++ trunk/src/org/hyperic/hq/events/server/session/AlertDAO.java 2009-11-20 23:41:01 UTC (rev 13987) @@ -6,7 +6,7 @@ * normal use of the program, and does *not* fall under the heading of * "derived work". * - * Copyright (C) [2004-2007], Hyperic, Inc. + * Copyright (C) [2004-2009], Hyperic, Inc. * This file is part of HQ. * * HQ is free software; you can redistribute it and/or modify @@ -24,8 +24,11 @@ */ package org.hyperic.hq.events.server.session; +import java.util.Arrays; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import org.hibernate.Query; import org.hibernate.criterion.Order; @@ -33,8 +36,10 @@ import org.hibernate.criterion.Restrictions; import org.hyperic.dao.DAOFactory; import org.hyperic.hibernate.PageInfo; +import org.hyperic.hq.authz.server.session.AuthzSubject; import org.hyperic.hq.authz.server.session.Resource; import org.hyperic.hq.authz.shared.AuthzConstants; +import org.hyperic.hq.authz.shared.EdgePermCheck; import org.hyperic.hq.authz.shared.PermissionManagerFactory; import org.hyperic.hq.dao.HibernateDAO; @@ -113,12 +118,7 @@ int priority, boolean inEsc, boolean notFixed, Integer groupId, Integer alertDefId, PageInfo pageInfo) { - String[] ops = - new String[] { AuthzConstants.platformOpManageAlerts, - AuthzConstants.serverOpManageAlerts, - AuthzConstants.serviceOpManageAlerts }; AlertSortField sort = (AlertSortField)pageInfo.getSort(); - Query q; String sql = PermissionManagerFactory.getInstance() .getAlertsHQL(inEsc, notFixed, groupId, alertDefId, false) @@ -132,7 +132,7 @@ " DESC"; } - q = getSession().createQuery(sql) + Query q = getSession().createQuery(sql) .setLong("begin", begin) .setLong("end", end) .setInteger("priority", priority); @@ -142,7 +142,7 @@ if (sql.indexOf("subj") > 0) { q.setInteger("subj", subj.intValue()) - .setParameterList("ops", ops); + .setParameterList("ops", AuthzConstants.MANAGE_ALERTS_OPS); } return pageInfo.pageResults(q).list(); @@ -152,24 +152,18 @@ int priority, boolean inEsc, boolean notFixed, Integer groupId, Integer alertDefId) - { - String[] ops = - new String[] { AuthzConstants.platformOpManageAlerts, - AuthzConstants.serverOpManageAlerts, - AuthzConstants.serviceOpManageAlerts }; - Query q; - + { String sql = PermissionManagerFactory.getInstance() .getAlertsHQL(inEsc, notFixed, groupId, alertDefId, true); - q = getSession().createQuery(sql) + Query q = getSession().createQuery(sql) .setLong("begin", begin) .setLong("end", end) .setInteger("priority", priority); if (sql.indexOf("subj") > 0) { q.setInteger("subj", subj.intValue()) - .setParameterList("ops", ops); + .setParameterList("ops", AuthzConstants.MANAGE_ALERTS_OPS); } return (Integer) q.uniqueResult(); @@ -256,7 +250,52 @@ return null; } } + + /** + * Return all last fixed alerts for the given resource + * + * @param subject The HQ user + * @param r The root resource + * @param fixed Boolean to indicate whether to get fixed or unfixed alerts + * @return + */ + public Map findLastByResource(AuthzSubject subject, + Resource r, + boolean includeDescendants, + boolean fixed) { + EdgePermCheck wherePermCheck = + getPermissionManager().makePermCheckHql("rez", includeDescendants); + + String hql = + new StringBuilder() + .append("select a ") + .append("from Alert a ") + .append("join a.alertDefinition ad ") + .append("join ad.resource rez ") + .append(wherePermCheck.toString()) + .append("and ad.deleted = false ") + .append("and a.fixed = :fixed ") + .append("order by a.ctime ") + .toString(); + + Query q = createQuery(hql).setBoolean("fixed", fixed); + + List alerts = wherePermCheck + .addQueryParameters(q, subject, r, 0, + Arrays.asList(AuthzConstants.MANAGE_ALERTS_OPS)) + .list(); + + Map lastAlerts = new HashMap(alerts.size()); + for (Iterator it=alerts.iterator(); it.hasNext(); ) { + Alert a = (Alert) it.next(); + // since it is ordered by ctime in ascending order, the + // last alert will eventually be put into the map + lastAlerts.put(a.getAlertDefinition().getId(), a); + } + return lastAlerts; + } + int deleteByAlertDefinition(AlertDefinition def) { String sql = "DELETE FROM Alert WHERE alertDefinition = :alertDef"; Modified: trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionDAO.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionDAO.java 2009-11-20 23:18:17 UTC (rev 13986) +++ trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionDAO.java 2009-11-20 23:41:01 UTC (rev 13987) @@ -54,11 +54,6 @@ import org.hyperic.hq.events.shared.RegisteredTriggerValue; public class AlertDefinitionDAO extends HibernateDAO { - private static final String[] MANAGE_ALERTS_OPS = new String[] { - AuthzConstants.platformOpManageAlerts, - AuthzConstants.serverOpManageAlerts, - AuthzConstants.serviceOpManageAlerts - }; public AlertDefinitionDAO(DAOFactory f) { super(AlertDefinition.class, f); @@ -201,7 +196,7 @@ return wherePermCheck .addQueryParameters(q, subject, r, 0, - Arrays.asList(MANAGE_ALERTS_OPS)).list(); + Arrays.asList(AuthzConstants.MANAGE_ALERTS_OPS)).list(); } void save(AlertDefinition def) { @@ -357,7 +352,7 @@ if (sql.indexOf("subj") > 0) { q.setInteger("subj", subj.getId().intValue()) - .setParameterList("ops", MANAGE_ALERTS_OPS); + .setParameterList("ops", AuthzConstants.MANAGE_ALERTS_OPS); } return pInfo.pageResults(q).list(); Modified: trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-11-20 23:18:17 UTC (rev 13986) +++ trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-11-20 23:41:01 UTC (rev 13987) @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.SortedMap; @@ -657,11 +658,44 @@ boolean enable) throws FinderException, PermissionException { - AlertDefinition def = getAlertDefDAO().get(defId); - - return updateAlertDefinitionInternalEnable(subj, def, enable); + return updateAlertDefinitionInternalEnable( + subj, Collections.singletonList(defId), enable); } + + /** + * Enable/Disable an alert definition. For internal use only where the mtime + * does not need to be reset on each update. + * + * @return <code>true</code> if the enable/disable succeeded. + * @ejb:interface-method + */ + public boolean updateAlertDefinitionInternalEnable(AuthzSubject subj, + List ids, + boolean enable) + throws PermissionException { + AlertDefinitionDAO dao = getAlertDefDAO(); + List triggerDefIds = new ArrayList(ids.size()); + + for (Iterator it = ids.iterator(); it.hasNext(); ) { + AlertDefinition def = dao.get((Integer) it.next()); + + if (def != null && def.isEnabled() != enable) { + canManageAlerts(subj, def.getAppdefEntityId()); + def.setEnabledStatus(enable); + triggerDefIds.add(def.getId()); + } + } + + if (!triggerDefIds.isEmpty()) { + // HQ-1799: enable the triggers in batch to improve performance + registeredTriggerManager.setAlertDefinitionTriggersEnabled(triggerDefIds, enable); + return true; + } else { + return false; + } + } + /** * Set the escalation on the alert definition * @@ -927,24 +961,6 @@ return new PageList(vals, vals.size()); } - /** Get list of all child conditions - * @ejb:interface-method - */ - public PageList findChildAlertDefinitions(Integer id) { - AlertDefinition def = getAlertDefDAO().findById(id); - List vals = new ArrayList(); - Collection ads = def.getChildren(); - for (Iterator i=ads.iterator(); i.hasNext(); ) { - AlertDefinition child = (AlertDefinition)i.next(); - // Don't touch the deleted children - if (!child.isDeleted() && child.getResource() != null) { - vals.add(child.getAlertDefinitionValue()); - } - } - - return new PageList(vals, vals.size()); - } - /** * Get the resource-specific alert definition ID by parent ID, allowing for * the query to return a stale copy of the alert definition (for efficiency Modified: trunk/src/org/hyperic/hq/events/server/session/AlertManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/AlertManagerEJBImpl.java 2009-11-20 23:18:17 UTC (rev 13986) +++ trunk/src/org/hyperic/hq/events/server/session/AlertManagerEJBImpl.java 2009-11-20 23:41:01 UTC (rev 13987) @@ -6,7 +6,7 @@ * normal use of the program, and does *not* fall under the heading of * "derived work". * - * Copyright (C) [2004-2008], Hyperic, Inc. + * Copyright (C) [2004-2009], Hyperic, Inc. * This file is part of HQ. * * HQ is free software; you can redistribute it and/or modify @@ -31,6 +31,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Set; import org.hyperic.util.stats.ConcurrentStatsCollector; @@ -77,6 +78,7 @@ import org.hyperic.util.pager.Pager; import org.hyperic.util.pager.SortAttribute; import org.hyperic.util.stats.ConcurrentStatsCollector; +import org.hyperic.util.timer.StopWatch; /** * @ejb:bean name="AlertManager" @@ -230,8 +232,7 @@ } /** - * Find the last alert by definition ID - * @throws PermissionException + * Find the last unfixed alert by definition ID * * @ejb:interface-method */ @@ -244,6 +245,33 @@ return null; } } + + /** + * Find the last alerts for the given resource + * + * @ejb:interface-method + */ + public Map findLastByResource(AuthzSubject subj, + Resource r, + boolean includeDescendants, + boolean fixed) { + + StopWatch watch = new StopWatch(); + Map unfixedAlerts = null; + try { + unfixedAlerts = + getAlertDAO().findLastByResource(subj, r, includeDescendants, fixed); + } catch (Exception e) { + unfixedAlerts = Collections.EMPTY_MAP; + _log.error("Error finding the last alerts for resource id=" + r.getId(), e); + } finally { + if (_log.isDebugEnabled()) { + _log.debug("findLastByResource: " + watch); + } + } + + return unfixedAlerts; + } /** * Find the last alert by definition ID Modified: trunk/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerEJBImpl.java =================================================================== --- trunk/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerEJBImpl.java 2009-11-20 23:18:17 UTC (rev 13986) +++ trunk/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerEJBImpl.java 2009-11-20 23:41:01 UTC (rev 13987) @@ -31,7 +31,11 @@ public class MockAlertDefinitionManagerEJBImpl implements AlertDefinitionManagerLocal, Verifiable { - public void cleanupAlertDefinitions(AppdefEntityID aeid) { + public List getAllDeletedAlertDefs() { + return null; + } + + public void cleanupAlertDefs(List alertDefIds) { // TODO Auto-generated method stub } @@ -127,11 +131,6 @@ return null; } - public PageList findChildAlertDefinitions(Integer id) { - // TODO Auto-generated method stub - return null; - } - public List findRelatedAlertDefinitions(AuthzSubject subj, Resource res) { // TODO Auto-generated method stub return null; @@ -245,13 +244,12 @@ return false; } - public boolean updateAlertDefinitionInternalEnableForceNewTxn( - AuthzSubject subj, Integer defId, boolean enable) - throws PermissionException { - // TODO Auto-generated method stub - return false; - } - + public boolean updateAlertDefinitionInternalEnable(AuthzSubject subj, + List ids, boolean enable) throws PermissionException { + // TODO Auto-generated method stub + return false; + } + public void updateAlertDefinitionsActiveStatus(AuthzSubject subj, Integer[] ids, boolean activate) throws PermissionException { // TODO Auto-generated method stub Modified: trunk/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerLocalHome.java =================================================================== --- trunk/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerLocalHome.java 2009-11-20 23:18:17 UTC (rev 13986) +++ trunk/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerLocalHome.java 2009-11-20 23:41:01 UTC (rev 13987) @@ -35,7 +35,11 @@ this.adMan = adMan; } - public void cleanupAlertDefinitions(AppdefEntityID aeid) { + public List getAllDeletedAlertDefs() { + return null; + } + + public void cleanupAlertDefs(List alertDefIds) { // TODO Auto-generated method stub } @@ -127,11 +131,6 @@ return null; } - public PageList findChildAlertDefinitions(Integer id) { - // TODO Auto-generated method stub - return null; - } - public List findRelatedAlertDefinitions(AuthzSubject subj, Resource res) { // TODO Auto-generated method stub return null; @@ -245,12 +244,12 @@ return false; } - public boolean updateAlertDefinitionInternalEnableForceNewTxn(AuthzSubject subj, Integer defId, boolean enable) throws PermissionException - { + public boolean updateAlertDefinitionInternalEnable(AuthzSubject subj, + List ids, boolean enable) throws PermissionException { // TODO Auto-generated method stub return false; } - + public void updateAlertDefinitionsActiveStatus(AuthzSubject subj, Integer[] ids, boolean activate) throws PermissionException { // TODO Auto-generated method stub |
From: <pn...@hy...> - 2009-11-20 23:18:31
|
Author: pnguyen Date: 2009-11-20 15:18:17 -0800 (Fri, 20 Nov 2009) New Revision: 13986 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13986 Modified: branches/HQ_4_2/tools/stresstests/resource_alert_driver.groovy Log: [HQ-1799] Use updated method Modified: branches/HQ_4_2/tools/stresstests/resource_alert_driver.groovy =================================================================== --- branches/HQ_4_2/tools/stresstests/resource_alert_driver.groovy 2009-11-20 23:16:45 UTC (rev 13985) +++ branches/HQ_4_2/tools/stresstests/resource_alert_driver.groovy 2009-11-20 23:18:17 UTC (rev 13986) @@ -218,7 +218,7 @@ def alertDefIds = null if (isResourceType) { - def resourceAlertDefs = adM.one.findChildAlertDefinitions(alertDefId) + def resourceAlertDefs = adM.one.findAlertDefinitionChildren(alertDefId) alertDefIds = resourceAlertDefs.collect {return it.id} } else { alertDefIds = [alertDefId] |
Author: pnguyen Date: 2009-11-20 15:16:45 -0800 (Fri, 20 Nov 2009) New Revision: 13985 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13985 Modified: branches/HQ_4_2/src/org/hyperic/hq/authz/shared/AuthzConstants.java branches/HQ_4_2/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java branches/HQ_4_2/src/org/hyperic/hq/events/Resources.properties branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDAO.java branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDefinitionDAO.java branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertManagerEJBImpl.java branches/HQ_4_2/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerEJBImpl.java branches/HQ_4_2/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerLocalHome.java Log: [HQ-1799] To improve performance, get the last unfixed alerts in batch and update the internal enabled flag in batch Modified: branches/HQ_4_2/src/org/hyperic/hq/authz/shared/AuthzConstants.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/authz/shared/AuthzConstants.java 2009-11-20 23:08:35 UTC (rev 13984) +++ branches/HQ_4_2/src/org/hyperic/hq/authz/shared/AuthzConstants.java 2009-11-20 23:16:45 UTC (rev 13985) @@ -191,6 +191,14 @@ public static final String ResourceEdgeContainmentRelation = "containment"; public static final String ResourceEdgeNetworkRelation = "network"; + // List of alert operations + public static final String[] MANAGE_ALERTS_OPS = + new String[] { + platformOpManageAlerts, + serverOpManageAlerts, + serviceOpManageAlerts + }; + public static boolean isOverlord(Integer subject) { return subject.equals(AuthzConstants.overlordId); } Modified: branches/HQ_4_2/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-11-20 23:08:35 UTC (rev 13984) +++ branches/HQ_4_2/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-11-20 23:16:45 UTC (rev 13985) @@ -1766,7 +1766,6 @@ PermissionException, SchedulerException { AuthzSubject subject = manager.getSubject(sessionId); - event.setModifiedBy(subject.getName()); return getMaintEvtMgr().schedule(subject, event); } Modified: branches/HQ_4_2/src/org/hyperic/hq/events/Resources.properties =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/events/Resources.properties 2009-11-20 23:08:35 UTC (rev 13984) +++ branches/HQ_4_2/src/org/hyperic/hq/events/Resources.properties 2009-11-20 23:16:45 UTC (rev 13985) @@ -37,8 +37,8 @@ eventLog.status.debug=Debug maintenance.window=Downtime Window -maintenance.window.state.start=Schedule started. {0} Alerts disabled. Availability measurements for {1} resources disabled. {2} errors occurred. -maintenance.window.state.end=Schedule ended. {0} Alerts enabled. Availability measurements for {1} resources enabled. {2} errors occurred. +maintenance.window.state.start=Started. Scheduled by {3}. {0} Alerts disabled. Availability measurements for {1} resources disabled. {2} errors occurred. +maintenance.window.state.end=Ended. Scheduled by {3}. {0} Alerts enabled. Availability measurements for {1} resources enabled. {2} errors occurred. maintenance.window.state.dead=Schedule skipped. maintenance.window.error.endDate=The end time must be after the start time. maintenance.window.error.illegalState=The downtime schedule is either invalid or has completed. Modified: branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDAO.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDAO.java 2009-11-20 23:08:35 UTC (rev 13984) +++ branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDAO.java 2009-11-20 23:16:45 UTC (rev 13985) @@ -6,7 +6,7 @@ * normal use of the program, and does *not* fall under the heading of * "derived work". * - * Copyright (C) [2004-2007], Hyperic, Inc. + * Copyright (C) [2004-2009], Hyperic, Inc. * This file is part of HQ. * * HQ is free software; you can redistribute it and/or modify @@ -24,8 +24,11 @@ */ package org.hyperic.hq.events.server.session; +import java.util.Arrays; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import org.hibernate.Query; import org.hibernate.criterion.Order; @@ -33,8 +36,10 @@ import org.hibernate.criterion.Restrictions; import org.hyperic.dao.DAOFactory; import org.hyperic.hibernate.PageInfo; +import org.hyperic.hq.authz.server.session.AuthzSubject; import org.hyperic.hq.authz.server.session.Resource; import org.hyperic.hq.authz.shared.AuthzConstants; +import org.hyperic.hq.authz.shared.EdgePermCheck; import org.hyperic.hq.authz.shared.PermissionManagerFactory; import org.hyperic.hq.dao.HibernateDAO; @@ -113,12 +118,7 @@ int priority, boolean inEsc, boolean notFixed, Integer groupId, Integer alertDefId, PageInfo pageInfo) { - String[] ops = - new String[] { AuthzConstants.platformOpManageAlerts, - AuthzConstants.serverOpManageAlerts, - AuthzConstants.serviceOpManageAlerts }; AlertSortField sort = (AlertSortField)pageInfo.getSort(); - Query q; String sql = PermissionManagerFactory.getInstance() .getAlertsHQL(inEsc, notFixed, groupId, alertDefId, false) @@ -132,7 +132,7 @@ " DESC"; } - q = getSession().createQuery(sql) + Query q = getSession().createQuery(sql) .setLong("begin", begin) .setLong("end", end) .setInteger("priority", priority); @@ -142,7 +142,7 @@ if (sql.indexOf("subj") > 0) { q.setInteger("subj", subj.intValue()) - .setParameterList("ops", ops); + .setParameterList("ops", AuthzConstants.MANAGE_ALERTS_OPS); } return pageInfo.pageResults(q).list(); @@ -152,24 +152,18 @@ int priority, boolean inEsc, boolean notFixed, Integer groupId, Integer alertDefId) - { - String[] ops = - new String[] { AuthzConstants.platformOpManageAlerts, - AuthzConstants.serverOpManageAlerts, - AuthzConstants.serviceOpManageAlerts }; - Query q; - + { String sql = PermissionManagerFactory.getInstance() .getAlertsHQL(inEsc, notFixed, groupId, alertDefId, true); - q = getSession().createQuery(sql) + Query q = getSession().createQuery(sql) .setLong("begin", begin) .setLong("end", end) .setInteger("priority", priority); if (sql.indexOf("subj") > 0) { q.setInteger("subj", subj.intValue()) - .setParameterList("ops", ops); + .setParameterList("ops", AuthzConstants.MANAGE_ALERTS_OPS); } return (Integer) q.uniqueResult(); @@ -256,7 +250,52 @@ return null; } } + + /** + * Return all last fixed alerts for the given resource + * + * @param subject The HQ user + * @param r The root resource + * @param fixed Boolean to indicate whether to get fixed or unfixed alerts + * @return + */ + public Map findLastByResource(AuthzSubject subject, + Resource r, + boolean includeDescendants, + boolean fixed) { + EdgePermCheck wherePermCheck = + getPermissionManager().makePermCheckHql("rez", includeDescendants); + + String hql = + new StringBuilder() + .append("select a ") + .append("from Alert a ") + .append("join a.alertDefinition ad ") + .append("join ad.resource rez ") + .append(wherePermCheck.toString()) + .append("and ad.deleted = false ") + .append("and a.fixed = :fixed ") + .append("order by a.ctime ") + .toString(); + + Query q = createQuery(hql).setBoolean("fixed", fixed); + + List alerts = wherePermCheck + .addQueryParameters(q, subject, r, 0, + Arrays.asList(AuthzConstants.MANAGE_ALERTS_OPS)) + .list(); + + Map lastAlerts = new HashMap(alerts.size()); + for (Iterator it=alerts.iterator(); it.hasNext(); ) { + Alert a = (Alert) it.next(); + // since it is ordered by ctime in ascending order, the + // last alert will eventually be put into the map + lastAlerts.put(a.getAlertDefinition().getId(), a); + } + return lastAlerts; + } + int deleteByAlertDefinition(AlertDefinition def) { String sql = "DELETE FROM Alert WHERE alertDefinition = :alertDef"; Modified: branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDefinitionDAO.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDefinitionDAO.java 2009-11-20 23:08:35 UTC (rev 13984) +++ branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDefinitionDAO.java 2009-11-20 23:16:45 UTC (rev 13985) @@ -54,11 +54,6 @@ import org.hyperic.hq.events.shared.RegisteredTriggerValue; public class AlertDefinitionDAO extends HibernateDAO { - private static final String[] MANAGE_ALERTS_OPS = new String[] { - AuthzConstants.platformOpManageAlerts, - AuthzConstants.serverOpManageAlerts, - AuthzConstants.serviceOpManageAlerts - }; public AlertDefinitionDAO(DAOFactory f) { super(AlertDefinition.class, f); @@ -201,7 +196,7 @@ return wherePermCheck .addQueryParameters(q, subject, r, 0, - Arrays.asList(MANAGE_ALERTS_OPS)).list(); + Arrays.asList(AuthzConstants.MANAGE_ALERTS_OPS)).list(); } void save(AlertDefinition def) { @@ -357,7 +352,7 @@ if (sql.indexOf("subj") > 0) { q.setInteger("subj", subj.getId().intValue()) - .setParameterList("ops", MANAGE_ALERTS_OPS); + .setParameterList("ops", AuthzConstants.MANAGE_ALERTS_OPS); } return pInfo.pageResults(q).list(); Modified: branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-11-20 23:08:35 UTC (rev 13984) +++ branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-11-20 23:16:45 UTC (rev 13985) @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.SortedMap; @@ -657,11 +658,44 @@ boolean enable) throws FinderException, PermissionException { - AlertDefinition def = getAlertDefDAO().get(defId); - - return updateAlertDefinitionInternalEnable(subj, def, enable); + return updateAlertDefinitionInternalEnable( + subj, Collections.singletonList(defId), enable); } + + /** + * Enable/Disable an alert definition. For internal use only where the mtime + * does not need to be reset on each update. + * + * @return <code>true</code> if the enable/disable succeeded. + * @ejb:interface-method + */ + public boolean updateAlertDefinitionInternalEnable(AuthzSubject subj, + List ids, + boolean enable) + throws PermissionException { + AlertDefinitionDAO dao = getAlertDefDAO(); + List triggerDefIds = new ArrayList(ids.size()); + + for (Iterator it = ids.iterator(); it.hasNext(); ) { + AlertDefinition def = dao.get((Integer) it.next()); + + if (def != null && def.isEnabled() != enable) { + canManageAlerts(subj, def.getAppdefEntityId()); + def.setEnabledStatus(enable); + triggerDefIds.add(def.getId()); + } + } + + if (!triggerDefIds.isEmpty()) { + // HQ-1799: enable the triggers in batch to improve performance + registeredTriggerManager.setAlertDefinitionTriggersEnabled(triggerDefIds, enable); + return true; + } else { + return false; + } + } + /** * Set the escalation on the alert definition * @@ -927,24 +961,6 @@ return new PageList(vals, vals.size()); } - /** Get list of all child conditions - * @ejb:interface-method - */ - public PageList findChildAlertDefinitions(Integer id) { - AlertDefinition def = getAlertDefDAO().findById(id); - List vals = new ArrayList(); - Collection ads = def.getChildren(); - for (Iterator i=ads.iterator(); i.hasNext(); ) { - AlertDefinition child = (AlertDefinition)i.next(); - // Don't touch the deleted children - if (!child.isDeleted() && child.getResource() != null) { - vals.add(child.getAlertDefinitionValue()); - } - } - - return new PageList(vals, vals.size()); - } - /** * Get the resource-specific alert definition ID by parent ID, allowing for * the query to return a stale copy of the alert definition (for efficiency Modified: branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertManagerEJBImpl.java =================================================================== --- branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertManagerEJBImpl.java 2009-11-20 23:08:35 UTC (rev 13984) +++ branches/HQ_4_2/src/org/hyperic/hq/events/server/session/AlertManagerEJBImpl.java 2009-11-20 23:16:45 UTC (rev 13985) @@ -6,7 +6,7 @@ * normal use of the program, and does *not* fall under the heading of * "derived work". * - * Copyright (C) [2004-2008], Hyperic, Inc. + * Copyright (C) [2004-2009], Hyperic, Inc. * This file is part of HQ. * * HQ is free software; you can redistribute it and/or modify @@ -31,6 +31,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Set; import org.hyperic.util.stats.ConcurrentStatsCollector; @@ -77,6 +78,7 @@ import org.hyperic.util.pager.Pager; import org.hyperic.util.pager.SortAttribute; import org.hyperic.util.stats.ConcurrentStatsCollector; +import org.hyperic.util.timer.StopWatch; /** * @ejb:bean name="AlertManager" @@ -230,8 +232,7 @@ } /** - * Find the last alert by definition ID - * @throws PermissionException + * Find the last unfixed alert by definition ID * * @ejb:interface-method */ @@ -244,6 +245,33 @@ return null; } } + + /** + * Find the last alerts for the given resource + * + * @ejb:interface-method + */ + public Map findLastByResource(AuthzSubject subj, + Resource r, + boolean includeDescendants, + boolean fixed) { + + StopWatch watch = new StopWatch(); + Map unfixedAlerts = null; + try { + unfixedAlerts = + getAlertDAO().findLastByResource(subj, r, includeDescendants, fixed); + } catch (Exception e) { + unfixedAlerts = Collections.EMPTY_MAP; + _log.error("Error finding the last alerts for resource id=" + r.getId(), e); + } finally { + if (_log.isDebugEnabled()) { + _log.debug("findLastByResource: " + watch); + } + } + + return unfixedAlerts; + } /** * Find the last alert by definition ID Modified: branches/HQ_4_2/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerEJBImpl.java =================================================================== --- branches/HQ_4_2/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerEJBImpl.java 2009-11-20 23:08:35 UTC (rev 13984) +++ branches/HQ_4_2/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerEJBImpl.java 2009-11-20 23:16:45 UTC (rev 13985) @@ -31,7 +31,11 @@ public class MockAlertDefinitionManagerEJBImpl implements AlertDefinitionManagerLocal, Verifiable { - public void cleanupAlertDefinitions(AppdefEntityID aeid) { + public List getAllDeletedAlertDefs() { + return null; + } + + public void cleanupAlertDefs(List alertDefIds) { // TODO Auto-generated method stub } @@ -127,11 +131,6 @@ return null; } - public PageList findChildAlertDefinitions(Integer id) { - // TODO Auto-generated method stub - return null; - } - public List findRelatedAlertDefinitions(AuthzSubject subj, Resource res) { // TODO Auto-generated method stub return null; @@ -245,13 +244,12 @@ return false; } - public boolean updateAlertDefinitionInternalEnableForceNewTxn( - AuthzSubject subj, Integer defId, boolean enable) - throws PermissionException { - // TODO Auto-generated method stub - return false; - } - + public boolean updateAlertDefinitionInternalEnable(AuthzSubject subj, + List ids, boolean enable) throws PermissionException { + // TODO Auto-generated method stub + return false; + } + public void updateAlertDefinitionsActiveStatus(AuthzSubject subj, Integer[] ids, boolean activate) throws PermissionException { // TODO Auto-generated method stub Modified: branches/HQ_4_2/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerLocalHome.java =================================================================== --- branches/HQ_4_2/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerLocalHome.java 2009-11-20 23:08:35 UTC (rev 13984) +++ branches/HQ_4_2/unittest/src/org/hyperic/hq/events/server/session/MockAlertDefinitionManagerLocalHome.java 2009-11-20 23:16:45 UTC (rev 13985) @@ -35,7 +35,11 @@ this.adMan = adMan; } - public void cleanupAlertDefinitions(AppdefEntityID aeid) { + public List getAllDeletedAlertDefs() { + return null; + } + + public void cleanupAlertDefs(List alertDefIds) { // TODO Auto-generated method stub } @@ -127,11 +131,6 @@ return null; } - public PageList findChildAlertDefinitions(Integer id) { - // TODO Auto-generated method stub - return null; - } - public List findRelatedAlertDefinitions(AuthzSubject subj, Resource res) { // TODO Auto-generated method stub return null; @@ -245,12 +244,12 @@ return false; } - public boolean updateAlertDefinitionInternalEnableForceNewTxn(AuthzSubject subj, Integer defId, boolean enable) throws PermissionException - { + public boolean updateAlertDefinitionInternalEnable(AuthzSubject subj, + List ids, boolean enable) throws PermissionException { // TODO Auto-generated method stub return false; } - + public void updateAlertDefinitionsActiveStatus(AuthzSubject subj, Integer[] ids, boolean activate) throws PermissionException { // TODO Auto-generated method stub |