From: <rm...@hy...> - 2008-12-05 04:21:06
|
Author: rmorgan Date: 2008-12-04 20:21:02 -0800 (Thu, 04 Dec 2008) New Revision: 11973 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=11973 Modified: trunk/src/org/hyperic/hq/appdef/server/session/AIQueueManagerEJBImpl.java Log: Rather than asking for the AI scan status to check if the agent is running use the agent ping command. It's more lightweight and does not have the issues that the scan status command has when there are many auto-discovered servers. [HHQ-2656] [merge from 4.0] Modified: trunk/src/org/hyperic/hq/appdef/server/session/AIQueueManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/appdef/server/session/AIQueueManagerEJBImpl.java 2008-12-05 04:18:38 UTC (rev 11972) +++ trunk/src/org/hyperic/hq/appdef/server/session/AIQueueManagerEJBImpl.java 2008-12-05 04:21:02 UTC (rev 11973) @@ -43,6 +43,8 @@ import org.hyperic.dao.DAOFactory; import org.hyperic.hq.agent.AgentConnectionException; import org.hyperic.hq.agent.AgentRemoteException; +import org.hyperic.hq.agent.client.AgentCommandsClient; +import org.hyperic.hq.agent.client.AgentCommandsClientFactory; import org.hyperic.hq.appdef.Ip; import org.hyperic.hq.appdef.ServiceCluster; import org.hyperic.hq.appdef.server.session.Platform; @@ -71,8 +73,6 @@ import org.hyperic.hq.autoinventory.AIPlatform; import org.hyperic.hq.autoinventory.AIServer; import org.hyperic.hq.autoinventory.AutoinventoryException; -import org.hyperic.hq.autoinventory.agent.client.AICommandsClient; -import org.hyperic.hq.autoinventory.agent.client.AICommandsClientFactory; import org.hyperic.hq.common.SystemException; import org.hyperic.hq.common.server.session.AuditManagerEJBImpl; import org.hyperic.hq.dao.AIIpDAO; @@ -545,10 +545,10 @@ // runtime discovery and enable metrics. if (isApproveAction && verifyLiveAgent) { try { - AICommandsClient client = - AICommandsClientFactory.getInstance() + AgentCommandsClient client = + AgentCommandsClientFactory.getInstance() .getClient(aiplatform.getAgentToken()); - client.getScanStatus(); + client.ping(); } catch (AgentNotFoundException e) { // In this case we just want to // remove the AIPlatform from the AIQ since the @@ -564,10 +564,6 @@ throw new AIQApprovalException( "Error connecting or communicating with agent " + e.getMessage(), e); - } catch (AutoinventoryException e) { - throw new AIQApprovalException( - "Error reading data from Remote Agent Value " + - e.getMessage(), e); } } |