From: <cl...@hy...> - 2008-06-03 00:32:37
|
Author: clee Date: 2008-06-02 17:32:35 -0700 (Mon, 02 Jun 2008) New Revision: 9713 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=9713 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/AppdefBossEJBImpl.java Log: [HHQ-1999] Need to update platform services, too, when platform configurations change [merge from HQ_3_2] Modified: trunk/src/org/hyperic/hq/bizapp/server/session/AppdefBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/AppdefBossEJBImpl.java 2008-06-03 00:29:56 UTC (rev 9712) +++ trunk/src/org/hyperic/hq/bizapp/server/session/AppdefBossEJBImpl.java 2008-06-03 00:32:35 UTC (rev 9713) @@ -3265,16 +3265,35 @@ } } - if (entityId.isServer() && (allConfigs.shouldConfigProduct() || - allConfigs.shouldConfigMetric())) { - // Look up the server's services - Server server = - getServerManager().findServerById(entityId.getId()); - for (Iterator it = server.getServices().iterator(); - it.hasNext(); ) { - Service service = (Service) it.next(); - ids.add(service.getEntityId()); + if (allConfigs.shouldConfigProduct() || + allConfigs.shouldConfigMetric()) { + List servers = new ArrayList(); + if (entityId.isServer()) { + servers.add( + getServerManager().findServerById(entityId.getId())); } + else if (entityId.isPlatform()) { + // Get the virtual servers + Platform plat = + getPlatformManager().findPlatformById(entityId.getId()); + for (Iterator it = plat.getServers().iterator(); + it.hasNext(); ) { + Server server = (Server) it.next(); + if (server.getServerType().isVirtual()) { + servers.add(server); + } + } + } + + for (Iterator it = servers.iterator(); it.hasNext(); ) { + // Look up the server's services + Server server = (Server) it.next(); + for (Iterator sit = server.getServices().iterator(); + sit.hasNext(); ) { + Service service = (Service) sit.next(); + ids.add(service.getEntityId()); + } + } } // if should configure RT |