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: <rm...@hy...> - 2007-03-13 01:35:36
|
Author: rmorgan Date: 2007-03-12 17:35:22 -0800 (Mon, 12 Mar 2007) New Revision: 3723 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3723 Modified: trunk/src/org/hyperic/hq/events/ext/RegisteredTriggers.java Log: Migrate RegisteredTriggers caches to ehcache. Modified: trunk/src/org/hyperic/hq/events/ext/RegisteredTriggers.java =================================================================== --- trunk/src/org/hyperic/hq/events/ext/RegisteredTriggers.java 2007-03-13 01:20:54 UTC (rev 3722) +++ trunk/src/org/hyperic/hq/events/ext/RegisteredTriggers.java 2007-03-13 01:35:22 UTC (rev 3723) @@ -37,21 +37,22 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Map; +import java.util.HashMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hyperic.hq.application.HQApp; import org.hyperic.hq.common.SystemException; import org.hyperic.hq.events.AbstractEvent; -import org.hyperic.hq.events.ActionExecuteException; -import org.hyperic.hq.events.EventTypeException; import org.hyperic.hq.events.InvalidTriggerDataException; import org.hyperic.hq.events.server.session.RegisteredTrigger; import org.hyperic.hq.events.server.session.TriggerChangeCallback; import org.hyperic.hq.events.shared.RegisteredTriggerManagerLocal; import org.hyperic.hq.events.shared.RegisteredTriggerManagerUtil; import org.hyperic.hq.events.shared.RegisteredTriggerValue; -import org.hyperic.util.collection.IntHashMap; +import net.sf.ehcache.Cache; +import net.sf.ehcache.CacheManager; +import net.sf.ehcache.Element; public class RegisteredTriggers { private final static Log log = @@ -60,18 +61,16 @@ public static final Integer KEY_ALL = new Integer(0); private static RegisteredTriggers singleton = new RegisteredTriggers(); - - /** Holds value of property initialized. */ + private boolean initialized = false; - - /** Holds value of property keyedByType. */ - private Hashtable keyedByType = new Hashtable(); - - /** Holds value of property keyedByTrigger. */ - private Hashtable keyedByTrigger = new Hashtable(); - - /** Creates a new instance of RegisteredTriggers */ + + private Cache _keyedByType; + private Cache _keyedById; + private RegisteredTriggers() { + _keyedByType = CacheManager.getInstance().getCache("TriggersByType"); + _keyedById = + CacheManager.getInstance().getCache("TriggerById"); } /** Initializes the cache. @@ -89,7 +88,7 @@ RegisteredTriggerManagerLocal rtm = RegisteredTriggerManagerUtil.getLocalHome().create(); - HashSet toRemove = new HashSet(this.keyedByTrigger.keySet()); + HashSet toRemove = new HashSet(_keyedById.getKeys()); Collection triggers = rtm.getAllTriggers(); for (Iterator i = triggers.iterator(); i.hasNext();) { @@ -146,23 +145,26 @@ Map triggers = new Hashtable(); // Look up by Event type - if (!keyedByType.containsKey(eventType)) { - if (create) - keyedByType.put(eventType, new IntHashMap()); - else + if (!_keyedByType.isKeyInCache(eventType)) { + if (create) { + Element el = new Element(eventType, new HashMap()); + _keyedByType.put(el); + } else { return triggers; + } } // Lookup by Instance - IntHashMap keyedByInstance = (IntHashMap) keyedByType.get(eventType); - if (!keyedByInstance.containsKey(instance.intValue())) { + Element el = _keyedByType.get(eventType); + HashMap keyedByInstance = (HashMap)el.getObjectValue(); + if (!keyedByInstance.containsKey(instance)) { if (create) - keyedByInstance.put(instance.intValue(), triggers); + keyedByInstance.put(instance, triggers); else return triggers; } - return (Map) keyedByInstance.get(instance.intValue()); + return (Map) keyedByInstance.get(instance); } public static Collection getInterestedTriggers(AbstractEvent event) { @@ -192,7 +194,7 @@ } public static boolean isTriggerInterested(AbstractEvent event) { - Map trigMap = null; + Map trigMap; // If the event happened more than a day ago, does anyone care? final long ONE_DAY = 86400000; @@ -217,7 +219,7 @@ } public static boolean isTriggerRegistered(Integer tid) { - return singleton.getKeyedByTrigger().containsKey(tid); + return singleton.getKeyedById().isKeyInCache(tid); } private void registerTrigger(RegisteredTriggerValue tv) @@ -254,11 +256,12 @@ } // Reverse register the trigger - if (!keyedByTrigger.containsKey(tv.getId())) { - keyedByTrigger.put(tv.getId(), new ArrayList()); + if (!_keyedById.isKeyInCache(tv.getId())) { + Element el = new Element(tv.getId(), new ArrayList()); + _keyedById.put(el); } - ArrayList triggerMaps = - (ArrayList) keyedByTrigger.get(tv.getId()); + Element el = _keyedById.get(tv.getId()); + ArrayList triggerMaps = (ArrayList) el.getObjectValue(); triggerMaps.add(triggers); } } @@ -266,7 +269,11 @@ private void unregisterTrigger(Integer tvId) { // Use the keyedByTrigger table to look up which maps to delete from - ArrayList triggerMaps = (ArrayList) keyedByTrigger.remove(tvId); + Element el = _keyedById.get(tvId); + if (el == null) // Can't unregister + return; + + ArrayList triggerMaps = (ArrayList)el.getObjectValue(); if (triggerMaps == null) // Can't unregister return; @@ -275,39 +282,31 @@ triggers.remove(tvId); } } - - /** Getter for property initialized. - * @return Value of property initialized. - * - */ + public boolean isInitialized() { return this.initialized; } - - /** Setter for property initialized. - * @param initialized New value of property initialized. - * - */ + public void setInitialized(boolean initialized) { this.initialized = initialized; } - + /** Getter for property keyedByType. * @return Value of property keyedByType. * */ - public Hashtable getKeyedByType() { - return this.keyedByType; + public Cache getKeyedByType() { + return _keyedByType; } - + /** Getter for property keyedByTrigger. * @return Value of property keyedByTrigger. * */ - public Hashtable getKeyedByTrigger() { - return this.keyedByTrigger; + public Cache getKeyedById() { + return _keyedById; } - + public class RegisteredTriggersUpdater implements TriggerChangeCallback { public void beforeTriggersDeleted(Collection triggers) { |
|
From: smith K. <sma...@fi...> - 2007-03-13 01:33:07
|
Two days ago i installed new hypericHQ 3.0 server and client on ubunu 6.10. and Solaris9
Before i have used hypericHQ 2.7 on the same servers.
I could monitor MYsql 5.0 Process(server) and Mysql 5.0 service(table, etc..) On Hyperic 2.7.
But there is no service of MySQL on Hyperic3.0
So to check why, i moved plugin/mysql-plugin.jar of 2.7 to mysql-plugin.jar of 3.0
Let me check agent.log and server.log
I found out this message on server.log
2007-03-13 09:44:32,531 INFO [org.hyperic.hq.autoinventory.server.session.RuntimeReportProcessor] Processing Runtime AI Report: [CompositeRRR
Report #0 from reporting server=10057:
Platform #0 ID=null FQDN=sun.ficas.co.kr
Server #0 ID=10057 Name=sun Linux FileServer Stype=FileServer serviceCount=7
Report #1 from reporting server=10055:
Platform #0 ID=null FQDN=sun.ficas.co.kr
Server #0 ID=null Name=sun MySQL 5.x phpbb2 Stype=MySQL 5.x serviceCount=60
Server #1 ID=null Name=sun MySQL 5.x smf Stype=MySQL 5.x serviceCount=41
Server #2 ID=null Name=sun MySQL 5.x vanilla Stype=MySQL 5.x serviceCount=16
Server #3 ID=null Name=sun MySQL 5.x information_schema Stype=MySQL 5.x serviceCount=16
Server #4 ID=null Name=sun MySQL 5.x confluence Stype=MySQL 5.x serviceCount=27
Server #5 ID=null Name=sun MySQL 5.x vinilla Stype=MySQL 5.x serviceCount=0
Server #6 ID=null Name=sun MySQL 5.x mysql Stype=MySQL 5.x serviceCount=17
Server #7 ID=null Name=sun MySQL 5.x jiradb Stype=MySQL 5.x serviceCount=86
Server #8 ID=null Name=sun MySQL 5.x phpbb_db Stype=MySQL 5.x serviceCount=0
But i cann't watch any information on autodiscovery.
Please Help me.
|
|
From: <rm...@hy...> - 2007-03-13 01:21:00
|
Author: rmorgan Date: 2007-03-12 17:20:54 -0800 (Mon, 12 Mar 2007) New Revision: 3722 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3722 Modified: trunk/etc/ehcache.xml Log: Rename trigger caches to better reflect thier usage. Modified: trunk/etc/ehcache.xml =================================================================== --- trunk/etc/ehcache.xml 2007-03-13 00:37:01 UTC (rev 3721) +++ trunk/etc/ehcache.xml 2007-03-13 01:20:54 UTC (rev 3722) @@ -137,12 +137,12 @@ memoryStoreEvictionPolicy="LRU"/> <!-- Registered Trigger caches, used outside of hibernate --> - <cache name="TriggerByType" + <cache name="TriggersByType" maxElementsInMemory="10000" timeToIdleSeconds="0" timeToLiveSeconds="0" memoryStoreEvictionPolicy="LRU"/> - <cache name="TriggerByTrigger" + <cache name="TriggerById" maxElementsInMemory="10000" timeToIdleSeconds="0" timeToLiveSeconds="0" |
|
From: <jt...@hy...> - 2007-03-13 00:37:06
|
Author: jtravis Date: 2007-03-12 16:37:01 -0800 (Mon, 12 Mar 2007) New Revision: 3721 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3721 Modified: trunk/src/org/hyperic/hq/measurement/server/session/DataManagerEJBImpl.java trunk/src/org/hyperic/hq/measurement/server/session/DataPoint.java Log: More debug output when we aren't able to put values into the DB. Modified: trunk/src/org/hyperic/hq/measurement/server/session/DataManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/server/session/DataManagerEJBImpl.java 2007-03-13 00:25:37 UTC (rev 3720) +++ trunk/src/org/hyperic/hq/measurement/server/session/DataManagerEJBImpl.java 2007-03-13 00:37:01 UTC (rev 3721) @@ -247,7 +247,7 @@ // XXX: Get a better connection here - directly from Hibernate conn = DBUtil.getConnByContext(getInitialContext(), DATASOURCE_NAME); - while (true) { + while (true && !left.isEmpty()) { int numLeft = left.size(); _log.debug("Attempting to insert " + numLeft + " points"); left = insertData(conn, left); @@ -265,12 +265,13 @@ _log.debug("Update left " + left.size() + " points to process"); - if (numLeft == left.size()) { + if (numLeft == left.size() && numLeft != 0) { + DataPoint remPt = (DataPoint)left.remove(0); // There are some entries that we weren't able to do // anything about ... that sucks. _log.warn("Unable to do anything about " + numLeft + " data points. Sorry."); - break; + _log.warn("Throwing away data point " + remPt); } } } catch(Exception e) { Modified: trunk/src/org/hyperic/hq/measurement/server/session/DataPoint.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/server/session/DataPoint.java 2007-03-13 00:25:37 UTC (rev 3720) +++ trunk/src/org/hyperic/hq/measurement/server/session/DataPoint.java 2007-03-13 00:37:01 UTC (rev 3721) @@ -1,7 +1,5 @@ package org.hyperic.hq.measurement.server.session; -import java.math.BigDecimal; - import org.hyperic.hq.product.MetricValue; /** @@ -24,4 +22,9 @@ public MetricValue getMetricValue() { return _val; } + + public String toString() { + return "id=" + _metricId + " val=" + _val.getValue() + + " time=" + _val.getTimestamp(); + } } |
|
From: <cl...@hy...> - 2007-03-13 00:25:39
|
Author: clee Date: 2007-03-12 16:25:37 -0800 (Mon, 12 Mar 2007) New Revision: 3720 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3720 Modified: trunk/src/org/hyperic/hq/ui/action/portlet/autoDisc/ViewAction.java Log: [HQ-568] AIQApprovalException is the nested exception now and cannot be caught. Doesn't matter though, there's only one place that sets the import error. Modified: trunk/src/org/hyperic/hq/ui/action/portlet/autoDisc/ViewAction.java =================================================================== --- trunk/src/org/hyperic/hq/ui/action/portlet/autoDisc/ViewAction.java 2007-03-13 00:22:47 UTC (rev 3719) +++ trunk/src/org/hyperic/hq/ui/action/portlet/autoDisc/ViewAction.java 2007-03-13 00:25:37 UTC (rev 3720) @@ -140,12 +140,10 @@ if (exc != null) { request.getSession().removeAttribute(Constants.IMPORT_ERROR_ATTR); log.error("Failed to approve AI report", exc); - if (exc instanceof AIQApprovalException) { - ActionMessage err = - new ActionMessage("dash.autoDiscovery.import.Error", - exc.getMessage()); - RequestUtils.setError(request, err, ActionMessages.GLOBAL_MESSAGE); - } + ActionMessage err = + new ActionMessage("dash.autoDiscovery.import.Error", + exc.getMessage()); + RequestUtils.setError(request, err, ActionMessages.GLOBAL_MESSAGE); } return null; } |
|
From: <jt...@hy...> - 2007-03-13 00:22:52
|
Author: jtravis Date: 2007-03-12 16:22:47 -0800 (Mon, 12 Mar 2007) New Revision: 3719 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3719 Added: trunk/src/org/hyperic/hq/common/server/session/GUIDGenerator.java Modified: trunk/src/org/hyperic/hq/common/server/session/ServerConfigManagerEJBImpl.java Log: Fix build problems by moving sigar stuff to a non ejb-impl class Added: trunk/src/org/hyperic/hq/common/server/session/GUIDGenerator.java =================================================================== --- trunk/src/org/hyperic/hq/common/server/session/GUIDGenerator.java (rev 0) +++ trunk/src/org/hyperic/hq/common/server/session/GUIDGenerator.java 2007-03-13 00:22:47 UTC (rev 3719) @@ -0,0 +1,80 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ +package org.hyperic.hq.common.server.session; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hyperic.sigar.NetFlags; +import org.hyperic.sigar.NetInterfaceConfig; +import org.hyperic.sigar.Sigar; +import org.safehaus.uuid.EthernetAddress; +import org.safehaus.uuid.UUIDGenerator; + +class GUIDGenerator { + private static final Log _log = LogFactory.getLog(GUIDGenerator.class); + + static String createGUID() { + Sigar sigar = null; + + try { + EthernetAddress eAddr; + sigar = new Sigar(); + String[] ifaces = sigar.getNetInterfaceList(); + String hwaddr = null; + + for (int i=0; i<ifaces.length; i++) { + NetInterfaceConfig cfg = + sigar.getNetInterfaceConfig(ifaces[i]); + + if (NetFlags.LOOPBACK_ADDRESS.equals(cfg.getAddress()) || + (cfg.getFlags() & NetFlags.IFF_LOOPBACK) != 0 || + NetFlags.NULL_HWADDR.equals(cfg.getHwaddr())) + { + continue; + } + + hwaddr = cfg.getHwaddr(); + break; + } + + if (hwaddr == null) { + _log.warn("Unable to get MAC hardware address -- none found"); + return null; + } + + _log.debug("Obtained HW MAC: " + hwaddr); + eAddr = new EthernetAddress(hwaddr); + return UUIDGenerator.getInstance() + .generateTimeBasedUUID(eAddr) + .toString(); + } catch(Exception e) { + _log.warn("Error while creating GUID", e); + return null; + } finally { + if (sigar != null) + sigar.close(); + } + } +} Modified: trunk/src/org/hyperic/hq/common/server/session/ServerConfigManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/common/server/session/ServerConfigManagerEJBImpl.java 2007-03-12 23:54:10 UTC (rev 3718) +++ trunk/src/org/hyperic/hq/common/server/session/ServerConfigManagerEJBImpl.java 2007-03-13 00:22:47 UTC (rev 3719) @@ -49,11 +49,6 @@ import org.hyperic.hq.common.shared.ServerConfigManagerLocal; import org.hyperic.hq.common.shared.ServerConfigManagerUtil; import org.hyperic.hq.dao.ConfigPropertyDAO; -import org.hyperic.sigar.NetFlags; -import org.hyperic.sigar.NetInterfaceConfig; -import org.hyperic.sigar.Sigar; -import org.hyperic.sigar.SigarProxy; -import org.hyperic.sigar.SigarProxyCache; import org.hyperic.util.ConfigPropertyException; import org.hyperic.util.StringUtil; import org.hyperic.util.jdbc.DBUtil; @@ -414,7 +409,7 @@ res = p.getProperty("HQ-GUID"); if (res == null || res.trim().length() == 0) { - if ((res = createGUID()) == null) + if ((res = GUIDGenerator.createGUID()) == null) return "unknown"; p.setProperty("HQ-GUID", res); try { @@ -426,45 +421,6 @@ return res; } - private String createGUID() { - try { - EthernetAddress eAddr; - Sigar sigar = new Sigar(); - SigarProxy proxy = SigarProxyCache.newInstance(sigar); - String[] ifaces = proxy.getNetInterfaceList(); - String hwaddr = null; - - for (int i=0; i<ifaces.length; i++) { - NetInterfaceConfig cfg = - sigar.getNetInterfaceConfig(ifaces[i]); - - if (NetFlags.LOOPBACK_ADDRESS.equals(cfg.getAddress()) || - (cfg.getFlags() & NetFlags.IFF_LOOPBACK) != 0 || - NetFlags.NULL_HWADDR.equals(cfg.getHwaddr())) - { - continue; - } - - hwaddr = cfg.getHwaddr(); - break; - } - - if (hwaddr == null) { - _log.warn("Unable to get MAC hardware address -- none found"); - return null; - } - - _log.debug("Obtained HW MAC: " + hwaddr); - eAddr = new EthernetAddress(hwaddr); - return UUIDGenerator.getInstance() - .generateTimeBasedUUID(eAddr) - .toString(); - } catch(Exception e) { - _log.warn("Error while creating GUID", e); - return null; - } - } - private static InitialContext ic = null; protected InitialContext getInitialContext() { if (ic == null) { |
|
From: Jon T. (JIRA) <ji...@hy...> - 2007-03-13 00:04:36
|
[ http://jira.hyperic.com/browse/HHQ-723?page=all ] Jon Travis resolved HHQ-723: ---------------------------- Resolution: Cannot Reproduce > Fixing galerts from recent alerts portlet or list alerts page causes stacktrace > ------------------------------------------------------------------------------- > > Key: HHQ-723 > URL: http://jira.hyperic.com/browse/HHQ-723 > Project: Hyperic HQ > Type: Bug > Components: Dashboard > Versions: 3.0.2 > Environment: Sever: 3.0.2 .EE build 313. Platform: Windows XP SP2 ,IE 7 > Reporter: Nipuna Bhayani > Assignee: Jon Travis > Fix For: 3.0.2 > > > Create a Alert with Escalation > Acknowledge the Alert > Go to the Dasboard > Select the Acknowledge Alert > Actual results: > Fixed button is still disabled in IE,works fine in Firefox -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.hyperic.com/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
From: <jt...@hy...> - 2007-03-12 23:54:15
|
Author: jtravis Date: 2007-03-12 15:54:10 -0800 (Mon, 12 Mar 2007) New Revision: 3718 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3718 Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java Log: Fix HQ-554. Deleting an action which was associated with an escalation will now mark it as deleted, but leave it in the DB to deal with FKs from the GalertActionLogs Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java 2007-03-12 23:53:46 UTC (rev 3717) +++ trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java 2007-03-12 23:54:10 UTC (rev 3718) @@ -181,8 +181,7 @@ unscheduleEscalation(e); - // Remove the actual action - ActionManagerEJBImpl.getOne().deleteAction(action); + ActionManagerEJBImpl.getOne().markActionDeleted(action); } /** |
|
From: <jt...@hy...> - 2007-03-12 23:53:49
|
Author: jtravis Date: 2007-03-12 15:53:46 -0800 (Mon, 12 Mar 2007) New Revision: 3717 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3717 Modified: trunk/installer/data/db-upgrade.xml trunk/sql/events/Action.hq-xml trunk/src/org/hyperic/hq/events/server/session/Action.java trunk/src/org/hyperic/hq/events/server/session/ActionManagerEJBImpl.java Log: Fix HQ-554. Deleting an action which was associated with an escalation will now mark it as deleted, but leave it in the DB to deal with FKs from the GalertActionLogs Modified: trunk/installer/data/db-upgrade.xml =================================================================== --- trunk/installer/data/db-upgrade.xml 2007-03-12 23:09:21 UTC (rev 3716) +++ trunk/installer/data/db-upgrade.xml 2007-03-12 23:53:46 UTC (rev 3717) @@ -4924,6 +4924,15 @@ </schema-directSQL> </schemaSpec> + <schemaSpec version="3.20"> + <schema-addColumn table="EAM_ACTION" column="DELETED" + columnType="BOOLEAN"/> + <schema-update table="EAM_ACTION" column="DELETED" + columnType="BOOLEAN" value="FALSE" /> + <schema-alterColumn table="EAM_ACTION" column="DELETED" + nullable="NOT NULL"/> + </schemaSpec> + </dbupgrade> </target> Modified: trunk/sql/events/Action.hq-xml =================================================================== --- trunk/sql/events/Action.hq-xml 2007-03-12 23:09:21 UTC (rev 3716) +++ trunk/sql/events/Action.hq-xml 2007-03-12 23:53:46 UTC (rev 3717) @@ -47,6 +47,11 @@ <key column="ACTION_ID" /> <one-to-many class="AlertActionLog" /> </bag> + + <property name="deleted"> + <column name="DELETED" not-null="true"/> + </property> + </class> </hibernate-mapping> Modified: trunk/src/org/hyperic/hq/events/server/session/Action.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/Action.java 2007-03-12 23:09:21 UTC (rev 3716) +++ trunk/src/org/hyperic/hq/events/server/session/Action.java 2007-03-12 23:53:46 UTC (rev 3717) @@ -28,7 +28,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -44,7 +43,6 @@ import org.hyperic.hq.events.NoOpAction; import org.hyperic.hq.events.shared.ActionValue; import org.hyperic.util.ArrayUtil; -import org.hyperic.util.StringUtil; import org.hyperic.util.config.ConfigResponse; import org.hyperic.util.config.EncodingException; import org.hyperic.util.json.JSON; @@ -65,7 +63,8 @@ private AlertDefinition _alertDef; private Collection _logEntries = new ArrayList(); private Collection _children = new ArrayList(); - + private boolean _deleted = false; + private ActionValue _valueObj; static Action newInstance(JSONObject json) @@ -205,6 +204,14 @@ _logEntries = logEntries; } + public boolean isDeleted() { + return _deleted; + } + + protected void setDeleted(boolean deleted) { + _deleted = deleted; + } + public ActionValue getActionValue() { if (_valueObj == null) _valueObj = new ActionValue(); Modified: trunk/src/org/hyperic/hq/events/server/session/ActionManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/ActionManagerEJBImpl.java 2007-03-12 23:09:21 UTC (rev 3716) +++ trunk/src/org/hyperic/hq/events/server/session/ActionManagerEJBImpl.java 2007-03-12 23:53:46 UTC (rev 3717) @@ -181,12 +181,13 @@ } /** - * Delete a free-standing action + * Mark a free-standing action as deleted. These actions will later be + * deleted by a cleanup thread. * * @ejb:interface-method */ - public void deleteAction(Action a) { - _actDAO.remove(a); + public void markActionDeleted(Action a) { + a.setDeleted(true); } private void setParentAction(ActionValue val, Action action) { |
|
From: <hy...@us...> - 2007-03-12 23:50:22
|
Revision: 7
http://hyperic-hq.svn.sourceforge.net/hyperic-hq/?rev=7&view=rev
Author: hyperic
Date: 2007-03-12 16:50:20 -0700 (Mon, 12 Mar 2007)
Log Message:
-----------
heartbeat of america
Modified Paths:
--------------
build.xml
etc/ehcache.xml
etc/version.properties
installer/data/db-upgrade.xml
plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkDevicePlatformDetector.java
sql/common-data.xml
sql/measurement/MeasurementData.hq-xml
sql/measurement/MeasurementHistData.hq-xml
src/org/hyperic/hq/appdef/server/session/Platform.java
src/org/hyperic/hq/appdef/server/session/PlatformManagerEJBImpl.java
src/org/hyperic/hq/appdef/server/session/ServerManagerEJBImpl.java
src/org/hyperic/hq/appdef/server/session/ServiceManagerEJBImpl.java
src/org/hyperic/hq/autoinventory/AIPlatform.java
src/org/hyperic/hq/bizapp/server/session/BossStartupListener.java
src/org/hyperic/hq/bizapp/server/session/ConfigBossEJBImpl.java
src/org/hyperic/hq/common/ConfigProperty.java
src/org/hyperic/hq/common/server/session/ServerConfigManagerEJBImpl.java
src/org/hyperic/hq/dao/PlatformDAO.java
src/org/hyperic/hq/dao/ServerDAO.java
src/org/hyperic/hq/dao/ServiceDAO.java
src/org/hyperic/hq/measurement/server/session/DataManagerEJBImpl.java
src/org/hyperic/hq/measurement/server/session/DataPoint.java
src/org/hyperic/hq/measurement/server/session/MeasurementData.java
src/org/hyperic/hq/measurement/server/session/MeasurementHistData.java
web/resource/platform/autodiscovery/ViewResourceActionDetail.jsp
web/resource/platform/autodiscovery/ViewTypeAndNetworkProperties.jsp
Added Paths:
-----------
sql/bizapp/
sql/bizapp/UpdateStatus.hq-xml
src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java
src/org/hyperic/hq/bizapp/server/session/UpdateStatus.java
src/org/hyperic/hq/bizapp/server/session/UpdateStatusDAO.java
src/org/hyperic/hq/bizapp/server/session/UpdateStatusMode.java
thirdparty/lib/commons-httpclient-3.0.1.jar
thirdparty/lib/jug-asl-2.0.0.jar
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rm...@hy...> - 2007-03-12 23:09:26
|
Author: rmorgan Date: 2007-03-12 15:09:21 -0800 (Mon, 12 Mar 2007) New Revision: 3716 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3716 Modified: trunk/etc/ehcache.xml Log: Add RegisteredTrigger caches. Modified: trunk/etc/ehcache.xml =================================================================== --- trunk/etc/ehcache.xml 2007-03-12 21:29:48 UTC (rev 3715) +++ trunk/etc/ehcache.xml 2007-03-12 23:09:21 UTC (rev 3716) @@ -136,6 +136,18 @@ timeToLiveSeconds="0" memoryStoreEvictionPolicy="LRU"/> + <!-- Registered Trigger caches, used outside of hibernate --> + <cache name="TriggerByType" + maxElementsInMemory="10000" + timeToIdleSeconds="0" + timeToLiveSeconds="0" + memoryStoreEvictionPolicy="LRU"/> + <cache name="TriggerByTrigger" + maxElementsInMemory="10000" + timeToIdleSeconds="0" + timeToLiveSeconds="0" + memoryStoreEvictionPolicy="LRU"/> + <!-- Agent Caches --> <cache name="org.hyperic.hq.appdef.Agent" maxElementsInMemory="100" |
|
From: Jon T. (JIRA) <ji...@hy...> - 2007-03-12 21:41:40
|
[ http://jira.hyperic.com/browse/HHQ-723?page=comments#action_15882 ] Jon Travis commented on HHQ-723: -------------------------------- Ok, clearly the problem that Heather is seeing is legit -- is it fixed, Charles? > Fixing galerts from recent alerts portlet or list alerts page causes stacktrace > ------------------------------------------------------------------------------- > > Key: HHQ-723 > URL: http://jira.hyperic.com/browse/HHQ-723 > Project: Hyperic HQ > Type: Bug > Components: Dashboard > Versions: 3.0.2 > Environment: Sever: 3.0.2 .EE build 313. Platform: Windows XP SP2 ,IE 7 > Reporter: Nipuna Bhayani > Assignee: Jon Travis > Fix For: 3.0.2 > > > Create a Alert with Escalation > Acknowledge the Alert > Go to the Dasboard > Select the Acknowledge Alert > Actual results: > Fixed button is still disabled in IE,works fine in Firefox -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.hyperic.com/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
From: <jt...@hy...> - 2007-03-12 21:29:52
|
Author: jtravis Date: 2007-03-12 13:29:48 -0800 (Mon, 12 Mar 2007) New Revision: 3715 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3715 Modified: trunk/installer/data/db-upgrade.xml Log: Also add id sequences to migration for update status Modified: trunk/installer/data/db-upgrade.xml =================================================================== --- trunk/installer/data/db-upgrade.xml 2007-03-12 21:24:33 UTC (rev 3714) +++ trunk/installer/data/db-upgrade.xml 2007-03-12 21:29:48 UTC (rev 3715) @@ -4905,6 +4905,22 @@ ignored NUMBER(1) NOT NULL ) </statement> + <statement targetDB="postgresql"> + CREATE SEQUENCE eam_update_status_id_seq + START WITH 10001 + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1 + </statement> + <statement targetDB="oracle"> + CREATE SEQUENCE eam_update_status_id_seq + START WITH 10001 + INCREMENT BY 1 + NOMAXVALUE + NOCYCLE + CACHE 10 + </statement> </schema-directSQL> </schemaSpec> |
|
From: <jt...@hy...> - 2007-03-12 21:24:36
|
Author: jtravis Date: 2007-03-12 13:24:33 -0800 (Mon, 12 Mar 2007) New Revision: 3714 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3714 Modified: trunk/installer/data/db-upgrade.xml Log: Gar, fix created table name Modified: trunk/installer/data/db-upgrade.xml =================================================================== --- trunk/installer/data/db-upgrade.xml 2007-03-12 21:24:01 UTC (rev 3713) +++ trunk/installer/data/db-upgrade.xml 2007-03-12 21:24:33 UTC (rev 3714) @@ -4897,7 +4897,7 @@ ) </statement> <statement targetDB="oracle"> - CREATE TABLE eam_mescalation_state ( + CREATE TABLE eam_update_status ( id integer NOT NULL, version_col NUMBER(19,0) DEFAULT 0 NOT NULL, report VARCHAR2(4000) NOT NULL, |
|
From: <jt...@hy...> - 2007-03-12 21:24:18
|
Author: jtravis Date: 2007-03-12 13:24:01 -0800 (Mon, 12 Mar 2007) New Revision: 3713 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3713 Modified: trunk/installer/data/db-upgrade.xml trunk/sql/bizapp/UpdateStatus.hq-xml Log: Add migration and not-null constraints for update status Modified: trunk/installer/data/db-upgrade.xml =================================================================== --- trunk/installer/data/db-upgrade.xml 2007-03-12 21:03:15 UTC (rev 3712) +++ trunk/installer/data/db-upgrade.xml 2007-03-12 21:24:01 UTC (rev 3713) @@ -4884,7 +4884,30 @@ dupFail="false" insertCmd="(ID, PROPKEY, PROPVALUE, DEFAULT_PROPVALUE, FREAD_ONLY) VALUES (55, 'HQ-GUID', '', '', '0')"/> </schemaSpec> - + + <schemaSpec version="3.19"> + <schema-directSQL> + <statement targetDB="postgresql"> + CREATE TABLE eam_update_status ( + id integer NOT NULL, + version_col bigint DEFAULT 0 NOT NULL, + report character varying(4000), + upmode integer NOT NULL, + ignored boolean NOT NULL + ) + </statement> + <statement targetDB="oracle"> + CREATE TABLE eam_mescalation_state ( + id integer NOT NULL, + version_col NUMBER(19,0) DEFAULT 0 NOT NULL, + report VARCHAR2(4000) NOT NULL, + upmode integer NOT NULL, + ignored NUMBER(1) NOT NULL + ) + </statement> + </schema-directSQL> + </schemaSpec> + </dbupgrade> </target> Modified: trunk/sql/bizapp/UpdateStatus.hq-xml =================================================================== --- trunk/sql/bizapp/UpdateStatus.hq-xml 2007-03-12 21:03:15 UTC (rev 3712) +++ trunk/sql/bizapp/UpdateStatus.hq-xml 2007-03-12 21:24:01 UTC (rev 3713) @@ -25,11 +25,11 @@ </property> <property name="updateModeEnum"> - <column name="UPMODE" /> + <column name="UPMODE" not-null="true"/> </property> <property name="ignored"> - <column name="IGNORED" /> + <column name="IGNORED" not-null="true"/> </property> </class> |
|
From: <jt...@hy...> - 2007-03-12 21:03:46
|
Author: jtravis Date: 2007-03-12 13:03:15 -0800 (Mon, 12 Mar 2007) New Revision: 3712 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3712 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java Log: Add methods needed by UI Modified: trunk/src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java 2007-03-12 20:41:15 UTC (rev 3711) +++ trunk/src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java 2007-03-12 21:03:15 UTC (rev 3712) @@ -46,6 +46,7 @@ import org.hyperic.hq.appdef.server.session.ServerManagerEJBImpl; import org.hyperic.hq.appdef.server.session.ServiceManagerEJBImpl; import org.hyperic.hq.bizapp.shared.UpdateBossLocal; +import org.hyperic.hq.bizapp.server.session.UpdateStatusMode; import org.hyperic.hq.bizapp.shared.UpdateBossUtil; import org.hyperic.hq.common.SystemException; import org.hyperic.hq.common.server.session.ServerConfigManagerEJBImpl; @@ -82,10 +83,11 @@ t.start(); } - private Properties getRequestInfo() { + private Properties getRequestInfo(UpdateStatus status) { Properties req = new Properties(); String guid = ServerConfigManagerEJBImpl.getOne().getGUID(); + req.setProperty("hq.updateStatusMode", "" + status.getMode().getCode()); req.setProperty("hq.version", ProductProperties.getVersion()); req.setProperty("hq.build", ProductProperties.getBuild()); req.setProperty("hq.guid", guid); @@ -123,11 +125,15 @@ * @ejb:transaction type="REQUIRED" */ public void fetchReport() { + UpdateStatus status = _updateDAO.get(); Properties req; byte[] reqBytes; - req = getRequestInfo(); + if (status.getMode().equals(UpdateStatusMode.NONE)) + return; + req = getRequestInfo(status); + try { ByteArrayOutputStream bOs = new ByteArrayOutputStream(); GZIPOutputStream gOs = new GZIPOutputStream(bOs); @@ -143,7 +149,8 @@ return; } - _log.debug("Sending report:\n" + req); + _log.debug("Generated report. Size=" + reqBytes.length + + " report:\n" + req); PostMethod post = new PostMethod(CHECK_URL); HttpClient c = new HttpClient(); @@ -170,7 +177,7 @@ } private void processReport(int statusCode, String response) { - UpdateStatus curStatus = _updateDAO.get(); + UpdateStatus curStatus = getOrCreateStatus(); if (response.length() >= 4000) { _log.warn("Update report exceeded 4k"); @@ -178,19 +185,66 @@ } // TODO: Check status code so we only save valid stuffs - if (curStatus == null) { - curStatus = new UpdateStatus(response, UpdateStatusMode.MAJOR); - _updateDAO.save(curStatus); + if (curStatus.getReport() != null && + curStatus.getReport().equals(response)) + { return; } - if (curStatus.getReport().equals(response)) - return; - curStatus.setReport(response); curStatus.setIgnored(false); } + /** + * Returns null if there is no status report (or it's been ignored), else + * the string status report + * + * @ejb:interface-method + * @ejb:transaction type="REQUIRED" + */ + public String getUpdateReport() { + UpdateStatus status = getOrCreateStatus(); + + if (status.isIgnored()) + return null; + + if (status.getReport() == null || status.getReport().equals("")) { + return null; + } + + return status.getReport(); + } + + /** + * @ejb:interface-method + * @ejb:transaction type="REQUIRED" + */ + public void setUpdateMode(UpdateStatusMode mode) { + UpdateStatus status = getOrCreateStatus(); + + status.setMode(mode); + } + + /** + * @ejb:interface-method + * @ejb:transaction type="REQUIRED" + */ + public void ignoreUpdate() { + UpdateStatus status = getOrCreateStatus(); + + status.setIgnored(true); + } + + private UpdateStatus getOrCreateStatus() { + UpdateStatus res = _updateDAO.get(); + + if (res == null) { + res = new UpdateStatus("", UpdateStatusMode.MAJOR); + _updateDAO.save(res); + } + return res; + } + private static class UpdateFetcher implements Runnable { public void run() { while(true) { |
|
From: <jt...@hy...> - 2007-03-12 20:41:17
|
Author: jtravis Date: 2007-03-12 12:41:15 -0800 (Mon, 12 Mar 2007) New Revision: 3711 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3711 Added: trunk/sql/bizapp/ trunk/sql/bizapp/UpdateStatus.hq-xml Log: Add update service hbm fileS Added: trunk/sql/bizapp/UpdateStatus.hq-xml =================================================================== --- trunk/sql/bizapp/UpdateStatus.hq-xml (rev 0) +++ trunk/sql/bizapp/UpdateStatus.hq-xml 2007-03-12 20:41:15 UTC (rev 3711) @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="iso-8859-1"?> + +<!DOCTYPE hibernate-mapping PUBLIC + "-//Hibernate/Hibernate Mapping DTD 3.0//EN" + "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> + +<hibernate-mapping package="org.hyperic.hq.bizapp.server.session"> + <class name="UpdateStatus" table="EAM_UPDATE_STATUS"> + <cache usage="read-write"/> + + <id name="id" type="integer"> + <meta attribute="scope-set">private</meta> + <column name="ID" not-null="true" /> + <generator class="sequence"> + <param name="sequence">EAM_UPDATE_STATUS_ID_SEQ</param> + </generator> + </id> + + <version name="_version_" type="long"> + <column name ="VERSION_COL" default="0" /> + </version> + + <property name="report"> + <column name="REPORT" length="4000"/> + </property> + + <property name="updateModeEnum"> + <column name="UPMODE" /> + </property> + + <property name="ignored"> + <column name="IGNORED" /> + </property> + </class> + +</hibernate-mapping> |
|
From: <jt...@hy...> - 2007-03-12 20:40:51
|
Author: jtravis Date: 2007-03-12 12:40:45 -0800 (Mon, 12 Mar 2007) New Revision: 3710 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3710 Added: trunk/src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java trunk/src/org/hyperic/hq/bizapp/server/session/UpdateStatus.java trunk/src/org/hyperic/hq/bizapp/server/session/UpdateStatusDAO.java trunk/src/org/hyperic/hq/bizapp/server/session/UpdateStatusMode.java Modified: trunk/src/org/hyperic/hq/bizapp/server/session/BossStartupListener.java Log: Add update notification service Modified: trunk/src/org/hyperic/hq/bizapp/server/session/BossStartupListener.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/BossStartupListener.java 2007-03-12 20:39:34 UTC (rev 3709) +++ trunk/src/org/hyperic/hq/bizapp/server/session/BossStartupListener.java 2007-03-12 20:40:45 UTC (rev 3710) @@ -7,5 +7,6 @@ { public void hqStarted() { EventsBossEJBImpl.getOne().startup(); + UpdateBossEJBImpl.getOne().startup(); } } Added: trunk/src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java (rev 0) +++ trunk/src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java 2007-03-12 20:40:45 UTC (rev 3710) @@ -0,0 +1,219 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.bizapp.server.session; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; +import java.util.zip.GZIPOutputStream; + +import javax.ejb.SessionBean; +import javax.ejb.SessionContext; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.methods.PostMethod; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.hyperic.dao.DAOFactory; +import org.hyperic.hq.appdef.server.session.PlatformManagerEJBImpl; +import org.hyperic.hq.appdef.server.session.ServerManagerEJBImpl; +import org.hyperic.hq.appdef.server.session.ServiceManagerEJBImpl; +import org.hyperic.hq.bizapp.shared.UpdateBossLocal; +import org.hyperic.hq.bizapp.shared.UpdateBossUtil; +import org.hyperic.hq.common.SystemException; +import org.hyperic.hq.common.server.session.ServerConfigManagerEJBImpl; +import org.hyperic.hq.common.shared.ProductProperties; +import org.hyperic.util.thread.LoggingThreadGroup; + + +/** + * @ejb:bean name="UpdateBoss" + * jndi-name="ejb/bizapp/UpdateBoss" + * local-jndi-name="LocalUpdateBoss" + * view-type="both" + * type="Stateless" + */ +public class UpdateBossEJBImpl + extends BizappSessionEJB + implements SessionBean +{ + private static final UpdateStatusDAO _updateDAO = + new UpdateStatusDAO(DAOFactory.getDAOFactory()); + private static final int CHECK_INTERVAL = 1000 * 60 * 60 * 24; + private static final String CHECK_URL = "http://support.hyperic.com/uns"; + + private final Log _log = LogFactory.getLog(UpdateBossEJBImpl.class); + + /** + * @ejb:interface-method + * @ejb:transaction type="REQUIRED" + */ + public void startup() { + LoggingThreadGroup grp = new LoggingThreadGroup("Update Notifier"); + Thread t = new Thread(grp, new UpdateFetcher(), "Update Notifier"); + + t.start(); + } + + private Properties getRequestInfo() { + Properties req = new Properties(); + String guid = ServerConfigManagerEJBImpl.getOne().getGUID(); + + req.setProperty("hq.version", ProductProperties.getVersion()); + req.setProperty("hq.build", ProductProperties.getBuild()); + req.setProperty("hq.guid", guid); + req.setProperty("platform.time", "" + System.currentTimeMillis()); + req.setProperty("os.name", System.getProperty("os.name")); + req.setProperty("os.arch", System.getProperty("os.arch")); + req.setProperty("os.version", System.getProperty("os.version")); + req.setProperty("java.version", System.getProperty("java.version")); + req.setProperty("java.vendor", System.getProperty("java.vendor")); + + List plats = PlatformManagerEJBImpl.getOne().getPlatformTypeCounts(); + List svrs = ServerManagerEJBImpl.getOne().getServerTypeCounts(); + List svcs = ServiceManagerEJBImpl.getOne().getServiceTypeCounts(); + + addResourceProperties(req, plats, "hq.rsrc.plat."); + addResourceProperties(req, svrs, "hq.rsrc.svr."); + addResourceProperties(req, svcs, "hq.rsrc.svc."); + return req; + } + + private void addResourceProperties(Properties p, List resCounts, + String prefix) + { + for (Iterator i=resCounts.iterator(); i.hasNext(); ) { + Object[] val = (Object[])i.next(); + + p.setProperty(prefix + val[0], "" + val[1]); + } + } + + /** + * Meant to be called internally by the fetching thread + * + * @ejb:interface-method + * @ejb:transaction type="REQUIRED" + */ + public void fetchReport() { + Properties req; + byte[] reqBytes; + + req = getRequestInfo(); + + try { + ByteArrayOutputStream bOs = new ByteArrayOutputStream(); + GZIPOutputStream gOs = new GZIPOutputStream(bOs); + + req.store(gOs, ""); + gOs.flush(); + gOs.close(); + bOs.flush(); + bOs.close(); + reqBytes = bOs.toByteArray(); + } catch(IOException e) { + _log.warn("Error creating report request", e); + return; + } + + _log.debug("Sending report:\n" + req); + + PostMethod post = new PostMethod(CHECK_URL); + HttpClient c = new HttpClient(); + c.setTimeout(5 * 60 * 1000); + + ByteArrayInputStream bIs = new ByteArrayInputStream(reqBytes); + + post.setRequestBody(bIs); + + String response; + int statusCode; + try { + statusCode = c.executeMethod(post); + + response = post.getResponseBodyAsString(); + } catch(Exception e) { + _log.warn("Unable to get updates", e); + return; + } finally { + post.releaseConnection(); + } + + processReport(statusCode, response); + } + + private void processReport(int statusCode, String response) { + UpdateStatus curStatus = _updateDAO.get(); + + if (response.length() >= 4000) { + _log.warn("Update report exceeded 4k"); + return; + } + + // TODO: Check status code so we only save valid stuffs + if (curStatus == null) { + curStatus = new UpdateStatus(response, UpdateStatusMode.MAJOR); + _updateDAO.save(curStatus); + return; + } + + if (curStatus.getReport().equals(response)) + return; + + curStatus.setReport(response); + curStatus.setIgnored(false); + } + + private static class UpdateFetcher implements Runnable { + public void run() { + while(true) { + UpdateBossEJBImpl.getOne().fetchReport(); + try { + Thread.sleep(CHECK_INTERVAL); + } catch(InterruptedException e) { + } + } + } + } + + public static UpdateBossLocal getOne() { + try { + return UpdateBossUtil.getLocalHome().create(); + } catch(Exception e) { + throw new SystemException(e); + } + } + + public void ejbCreate() { } + public void ejbRemove() { } + public void ejbActivate() { } + public void ejbPassivate() { } + public void setSessionContext(SessionContext c) {} +} Added: trunk/src/org/hyperic/hq/bizapp/server/session/UpdateStatus.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/UpdateStatus.java (rev 0) +++ trunk/src/org/hyperic/hq/bizapp/server/session/UpdateStatus.java 2007-03-12 20:40:45 UTC (rev 3710) @@ -0,0 +1,52 @@ +package org.hyperic.hq.bizapp.server.session; + +import org.hyperic.hibernate.PersistedObject; + +public class UpdateStatus + extends PersistedObject +{ + private String _report; + private int _updateModeEnum; + private boolean _ignored; + + protected UpdateStatus() { + } + + UpdateStatus(String report, UpdateStatusMode mode) { + _report = report; + _updateModeEnum = mode.getCode(); + _ignored = false; + } + + public String getReport() { + return _report; + } + + protected void setReport(String report) { + _report = report; + } + + protected int getUpdateModeEnum() { + return _updateModeEnum; + } + + protected void setUpdateModeEnum(int mode) { + _updateModeEnum = mode; + } + + public UpdateStatusMode getMode() { + return UpdateStatusMode.findByCode(_updateModeEnum); + } + + void setMode(UpdateStatusMode mode) { + _updateModeEnum = mode.getCode(); + } + + public boolean isIgnored() { + return _ignored; + } + + protected void setIgnored(boolean ignored) { + _ignored = ignored; + } +} Added: trunk/src/org/hyperic/hq/bizapp/server/session/UpdateStatusDAO.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/UpdateStatusDAO.java (rev 0) +++ trunk/src/org/hyperic/hq/bizapp/server/session/UpdateStatusDAO.java 2007-03-12 20:40:45 UTC (rev 3710) @@ -0,0 +1,28 @@ +package org.hyperic.hq.bizapp.server.session; + +import java.util.Collection; + +import org.hyperic.dao.DAOFactory; +import org.hyperic.hq.dao.HibernateDAO; + +public class UpdateStatusDAO + extends HibernateDAO +{ + public UpdateStatusDAO(DAOFactory f) { + super(UpdateStatus.class, f); + } + + UpdateStatus get() { + Collection vals = findAll(); + + if (vals.isEmpty()) { + return null; + } + + return (UpdateStatus)vals.iterator().next(); + } + + void save(UpdateStatus status) { + super.save(status); + } +} Added: trunk/src/org/hyperic/hq/bizapp/server/session/UpdateStatusMode.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/UpdateStatusMode.java (rev 0) +++ trunk/src/org/hyperic/hq/bizapp/server/session/UpdateStatusMode.java 2007-03-12 20:40:45 UTC (rev 3710) @@ -0,0 +1,22 @@ +package org.hyperic.hq.bizapp.server.session; + +import org.hyperic.util.HypericEnum; + +public class UpdateStatusMode + extends HypericEnum +{ + public static final UpdateStatusMode ALL = + new UpdateStatusMode(0, "All"); + public static final UpdateStatusMode MAJOR = + new UpdateStatusMode(1, "Major"); + public static final UpdateStatusMode NONE = + new UpdateStatusMode(2, "None"); + + private UpdateStatusMode(int code, String desc) { + super(code, desc); + } + + public static UpdateStatusMode findByCode(int code) { + return (UpdateStatusMode)findByCode(UpdateStatusMode.class, code); + } +} |
|
From: <jt...@hy...> - 2007-03-12 20:39:36
|
Author: jtravis Date: 2007-03-12 12:39:34 -0800 (Mon, 12 Mar 2007) New Revision: 3709 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3709 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/ConfigBossEJBImpl.java Log: Add getOne() Modified: trunk/src/org/hyperic/hq/bizapp/server/session/ConfigBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/ConfigBossEJBImpl.java 2007-03-12 20:35:41 UTC (rev 3708) +++ trunk/src/org/hyperic/hq/bizapp/server/session/ConfigBossEJBImpl.java 2007-03-12 20:39:34 UTC (rev 3709) @@ -39,6 +39,8 @@ import org.hyperic.hq.authz.shared.PermissionException; import org.hyperic.hq.authz.shared.PermissionManager; import org.hyperic.hq.authz.shared.PermissionManagerFactory; +import org.hyperic.hq.bizapp.shared.ConfigBossLocal; +import org.hyperic.hq.bizapp.shared.ConfigBossUtil; import org.hyperic.hq.common.ApplicationException; import org.hyperic.hq.common.SystemException; import org.hyperic.hq.common.server.session.ServerConfigManagerEJBImpl; @@ -57,7 +59,6 @@ extends BizappSessionEJB implements SessionBean { - private SessionManager sessionManager = SessionManager.getInstance(); /** @@ -136,6 +137,14 @@ } return getServerConfigManager().vacuum(); } + + public static ConfigBossLocal getOne() { + try { + return ConfigBossUtil.getLocalHome().create(); + } catch (Exception e) { + throw new SystemException(e); + } + } public void ejbCreate() { } public void ejbRemove() { } |
|
From: <jt...@hy...> - 2007-03-12 20:35:48
|
Author: jtravis Date: 2007-03-12 12:35:41 -0800 (Mon, 12 Mar 2007) New Revision: 3708 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3708 Modified: trunk/build.xml Log: Include jug and httpclient in distribution Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2007-03-12 20:35:24 UTC (rev 3707) +++ trunk/build.xml 2007-03-12 20:35:41 UTC (rev 3708) @@ -380,6 +380,8 @@ <include name="dnsjava-2.0.3.jar" /> <include name="ehcache-1.2.4.jar" /> <include name="json.jar" /> + <include name="jug-asl-2.0.0.jar" /> + <include name="commons-httpclient-3.0.1.jar" /> <!-- replacement j2ee compile required for instantj since our installer doesn't install tools.jar --> |
|
From: <jt...@hy...> - 2007-03-12 20:35:30
|
Author: jtravis Date: 2007-03-12 12:35:24 -0800 (Mon, 12 Mar 2007) New Revision: 3707 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3707 Added: trunk/thirdparty/lib/commons-httpclient-3.0.1.jar Log: Add commons-httpclient Added: trunk/thirdparty/lib/commons-httpclient-3.0.1.jar =================================================================== (Binary files differ) Property changes on: trunk/thirdparty/lib/commons-httpclient-3.0.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
|
From: <jt...@hy...> - 2007-03-12 20:29:41
|
Author: jtravis Date: 2007-03-12 12:29:38 -0800 (Mon, 12 Mar 2007) New Revision: 3706 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3706 Modified: trunk/installer/data/db-upgrade.xml trunk/sql/common-data.xml Log: Add GUID into server config table Modified: trunk/installer/data/db-upgrade.xml =================================================================== --- trunk/installer/data/db-upgrade.xml 2007-03-12 20:28:18 UTC (rev 3705) +++ trunk/installer/data/db-upgrade.xml 2007-03-12 20:29:38 UTC (rev 3706) @@ -4879,13 +4879,11 @@ </schema-directSQL> </schemaSpec> - <!-- <schemaSpec version="3.18"> <schema-insert table="EAM_CONFIG_PROPS" dupFail="false" insertCmd="(ID, PROPKEY, PROPVALUE, DEFAULT_PROPVALUE, FREAD_ONLY) VALUES (55, 'HQ-GUID', '', '', '0')"/> </schemaSpec> - --> </dbupgrade> Modified: trunk/sql/common-data.xml =================================================================== --- trunk/sql/common-data.xml 2007-03-12 20:28:18 UTC (rev 3705) +++ trunk/sql/common-data.xml 2007-03-12 20:29:38 UTC (rev 3706) @@ -163,6 +163,11 @@ FREAD_ONLY="FALSE"/> <data ID="54" PROPKEY="KERBEROS_DEBUG" PROPVALUE="" DEFAULT_PROPVALUE="" FREAD_ONLY="FALSE"/> + + <!-- Update notification service --> + <data ID="55" PROPKEY="HQ-GUID" PROPVALUE="" DEFAULT_PROPVALUE="" + FREAD_ONLY="FALSE"/> + </table> </Covalent.DBSetup> |
|
From: <jt...@hy...> - 2007-03-12 20:28:28
|
Author: jtravis Date: 2007-03-12 12:28:18 -0800 (Mon, 12 Mar 2007) New Revision: 3705 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3705 Modified: trunk/src/org/hyperic/hq/appdef/server/session/PlatformManagerEJBImpl.java trunk/src/org/hyperic/hq/appdef/server/session/ServerManagerEJBImpl.java trunk/src/org/hyperic/hq/appdef/server/session/ServiceManagerEJBImpl.java trunk/src/org/hyperic/hq/dao/PlatformDAO.java trunk/src/org/hyperic/hq/dao/ServerDAO.java trunk/src/org/hyperic/hq/dao/ServiceDAO.java Log: Add methods to get resource type counts Modified: trunk/src/org/hyperic/hq/appdef/server/session/PlatformManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/appdef/server/session/PlatformManagerEJBImpl.java 2007-03-12 20:27:21 UTC (rev 3704) +++ trunk/src/org/hyperic/hq/appdef/server/session/PlatformManagerEJBImpl.java 2007-03-12 20:28:18 UTC (rev 3705) @@ -1374,6 +1374,17 @@ getPlatformDAO().remove(ip); } + /** + * Returns a list of 2 element arrays. The first element is the name of + * the platform type, the second element is the # of platforms of that + * type in the inventory. + * + * @ejb:interface-method + */ + public List getPlatformTypeCounts() { + return getPlatformDAO().getPlatformTypeCounts(); + } + public static PlatformManagerLocal getOne() { try { return PlatformManagerUtil.getLocalHome().create(); Modified: trunk/src/org/hyperic/hq/appdef/server/session/ServerManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/appdef/server/session/ServerManagerEJBImpl.java 2007-03-12 20:27:21 UTC (rev 3704) +++ trunk/src/org/hyperic/hq/appdef/server/session/ServerManagerEJBImpl.java 2007-03-12 20:28:18 UTC (rev 3705) @@ -1348,6 +1348,17 @@ server.setName(server.getName().trim()); } + /** + * Returns a list of 2 element arrays. The first element is the name of + * the server type, the second element is the # of servers of that + * type in the inventory. + * + * @ejb:interface-method + */ + public List getServerTypeCounts() { + return getServerDAO().getServerTypeCounts(); + } + public static ServerManagerLocal getOne() { try { return ServerManagerUtil.getLocalHome().create(); Modified: trunk/src/org/hyperic/hq/appdef/server/session/ServiceManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/appdef/server/session/ServiceManagerEJBImpl.java 2007-03-12 20:27:21 UTC (rev 3704) +++ trunk/src/org/hyperic/hq/appdef/server/session/ServiceManagerEJBImpl.java 2007-03-12 20:28:18 UTC (rev 3705) @@ -1698,6 +1698,17 @@ } } + /** + * Returns a list of 2 element arrays. The first element is the name of + * the service type, the second element is the # of services of that + * type in the inventory. + * + * @ejb:interface-method + */ + public List getServiceTypeCounts() { + return getServiceDAO().getServiceTypeCounts(); + } + public static ServiceManagerLocal getOne() { try { return ServiceManagerUtil.getLocalHome().create(); Modified: trunk/src/org/hyperic/hq/dao/PlatformDAO.java =================================================================== --- trunk/src/org/hyperic/hq/dao/PlatformDAO.java 2007-03-12 20:27:21 UTC (rev 3704) +++ trunk/src/org/hyperic/hq/dao/PlatformDAO.java 2007-03-12 20:28:18 UTC (rev 3705) @@ -337,4 +337,12 @@ } return platforms; } + + public List getPlatformTypeCounts() { + String sql = "select t.name, count(*) from PlatformType t, " + + "Platform p where p.platformType = t " + + "group by t.name order by t.name"; + + return getSession().createQuery(sql).list(); + } } Modified: trunk/src/org/hyperic/hq/dao/ServerDAO.java =================================================================== --- trunk/src/org/hyperic/hq/dao/ServerDAO.java 2007-03-12 20:27:21 UTC (rev 3704) +++ trunk/src/org/hyperic/hq/dao/ServerDAO.java 2007-03-12 20:28:18 UTC (rev 3705) @@ -219,4 +219,13 @@ } return servers; } + + public List getServerTypeCounts() { + String sql = "select t.name, count(*) from ServerType t, " + + "Server s where s.serverType = t " + + "group by t.name order by t.name"; + + return getSession().createQuery(sql).list(); + } + } Modified: trunk/src/org/hyperic/hq/dao/ServiceDAO.java =================================================================== --- trunk/src/org/hyperic/hq/dao/ServiceDAO.java 2007-03-12 20:27:21 UTC (rev 3704) +++ trunk/src/org/hyperic/hq/dao/ServiceDAO.java 2007-03-12 20:28:18 UTC (rev 3705) @@ -436,4 +436,12 @@ } return services; } + + public List getServiceTypeCounts() { + String sql = "select t.name, count(*) from ServiceType t, " + + "Service s where s.serviceType = t " + + "group by t.name order by t.name"; + + return getSession().createQuery(sql).list(); + } } |
|
From: <jt...@hy...> - 2007-03-12 20:27:26
|
Author: jtravis Date: 2007-03-12 12:27:21 -0800 (Mon, 12 Mar 2007) New Revision: 3704 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3704 Modified: trunk/src/org/hyperic/hq/common/ConfigProperty.java Log: Cleanup Modified: trunk/src/org/hyperic/hq/common/ConfigProperty.java =================================================================== --- trunk/src/org/hyperic/hq/common/ConfigProperty.java 2007-03-12 20:25:36 UTC (rev 3703) +++ trunk/src/org/hyperic/hq/common/ConfigProperty.java 2007-03-12 20:27:21 UTC (rev 3704) @@ -27,114 +27,86 @@ import org.hyperic.hibernate.PersistedObject; -/** - * ConfigProperty generated by hbm2java - */ -public class ConfigProperty extends PersistedObject +public class ConfigProperty + extends PersistedObject { - // Fields - private String prefix; - private String key; - private String value; - private String defaultValue; - private boolean readOnly = false; + private String _prefix; + private String _key; + private String _value; + private String _defaultValue; + private boolean _readOnly = false; - // Constructors - - /** - * default constructor - */ - public ConfigProperty() - { - super(); + public ConfigProperty() { } - // Property accessors - - public String getPrefix() - { - return this.prefix; + public String getPrefix() { + return _prefix; } - public void setPrefix(String prefix) - { - this.prefix = prefix; + public void setPrefix(String prefix) { + _prefix = prefix; } - public String getKey() - { - return this.key; + public String getKey() { + return _key; } - public void setKey(String propKey) - { - this.key = propKey; + public void setKey(String propKey) { + _key = propKey; } - public String getValue() - { - return this.value; + public String getValue() { + return _value; } - public void setValue(String propValue) - { - this.value = propValue; + public void setValue(String propValue) { + _value = propValue; } - public String getDefaultValue() - { - return this.defaultValue; + public String getDefaultValue() { + return _defaultValue; } - public void setDefaultValue(String defaultPropValue) - { - this.defaultValue = defaultPropValue; + public void setDefaultValue(String defaultPropValue) { + _defaultValue = defaultPropValue; } - public boolean isReadOnly() - { - return this.readOnly; + public boolean isReadOnly() { + return _readOnly; } /** * @deprecated use isReadOnly() - * @return */ - public boolean getReadOnly() - { + public boolean getReadOnly() { return isReadOnly(); } - public void setReadOnly(boolean flag) - { - this.readOnly = flag; + public void setReadOnly(boolean flag) { + _readOnly = flag; } - public boolean equals(Object obj) - { + public boolean equals(Object obj) { if (!(obj instanceof ConfigProperty) || !super.equals(obj)) { return false; } ConfigProperty o = (ConfigProperty) obj; return - ((prefix == o.getPrefix()) || - (prefix != null && o.getPrefix() != null && - prefix.equals(o.getPrefix()))) + ((_prefix == o.getPrefix()) || + (_prefix != null && o.getPrefix() != null && + _prefix.equals(o.getPrefix()))) && - ((key == o.getKey()) || - (key != null && o.getKey() != null && - key.equals(o.getKey()))); + ((_key == o.getKey()) || + (_key != null && o.getKey() != null && + _key.equals(o.getKey()))); } - public int hashCode() - { + public int hashCode() { int result = super.hashCode(); - result = 37*result + (prefix != null ? prefix.hashCode() : 0); - result = 37*result + (key != null ? key.hashCode() : 0); + result = 37*result + (_prefix != null ? _prefix.hashCode() : 0); + result = 37*result + (_key != null ? _key.hashCode() : 0); return result; } } - - |
|
From: <jt...@hy...> - 2007-03-12 20:25:38
|
Author: jtravis Date: 2007-03-12 12:25:36 -0800 (Mon, 12 Mar 2007) New Revision: 3703 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3703 Added: trunk/thirdparty/lib/jug-asl-2.0.0.jar Log: Add JUG -- needed to generate guid Added: trunk/thirdparty/lib/jug-asl-2.0.0.jar =================================================================== (Binary files differ) Property changes on: trunk/thirdparty/lib/jug-asl-2.0.0.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |