|
From: <cl...@hy...> - 2007-03-14 00:11:23
|
Author: clee Date: 2007-03-13 16:11:14 -0800 (Tue, 13 Mar 2007) New Revision: 3745 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3745 Modified: trunk/src/org/hyperic/hq/ui/action/resource/platform/autodiscovery/EditAutoDiscoveryAction.java trunk/src/org/hyperic/hq/ui/action/resource/platform/autodiscovery/NewAutoDiscoveryAction.java trunk/src/org/hyperic/hq/ui/action/resource/platform/autodiscovery/PlatformAutoDiscoveryForm.java trunk/web/WEB-INF/classes/ApplicationResources.properties trunk/web/resource/platform/autodiscovery/NewAutoDiscovery.jsp Log: [HQ-580] Remove scheduling and recurrence for auto-discovery Modified: trunk/src/org/hyperic/hq/ui/action/resource/platform/autodiscovery/EditAutoDiscoveryAction.java =================================================================== --- trunk/src/org/hyperic/hq/ui/action/resource/platform/autodiscovery/EditAutoDiscoveryAction.java 2007-03-13 22:59:04 UTC (rev 3744) +++ trunk/src/org/hyperic/hq/ui/action/resource/platform/autodiscovery/EditAutoDiscoveryAction.java 2007-03-14 00:11:14 UTC (rev 3745) @@ -25,6 +25,8 @@ package org.hyperic.hq.ui.action.resource.platform.autodiscovery; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.hyperic.hq.autoinventory.ScanConfiguration; import org.hyperic.hq.autoinventory.ScanMethod; import org.hyperic.hq.autoinventory.ScanMethodConfig; @@ -32,26 +34,12 @@ import org.hyperic.hq.bizapp.shared.AIBoss; import org.hyperic.util.config.ConfigResponse; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.struts.action.ActionMapping; - public class EditAutoDiscoveryAction extends NewAutoDiscoveryAction { private static final Log log = LogFactory.getLog(EditAutoDiscoveryAction.class.getName()); /** - * removes a AIScheduleValue object if already created. - */ - protected void removeAISchedule(AIBoss aiboss, - int sessionId, Integer sid) - throws Exception { - Integer[] ids = {sid}; - aiboss.deleteAIJob(sessionId, ids); - } - - /** * load the AIScheduleValue if needed */ private AIScheduleValue getAIScheduleValue(AIBoss aiboss, Modified: trunk/src/org/hyperic/hq/ui/action/resource/platform/autodiscovery/NewAutoDiscoveryAction.java =================================================================== --- trunk/src/org/hyperic/hq/ui/action/resource/platform/autodiscovery/NewAutoDiscoveryAction.java 2007-03-13 22:59:04 UTC (rev 3744) +++ trunk/src/org/hyperic/hq/ui/action/resource/platform/autodiscovery/NewAutoDiscoveryAction.java 2007-03-14 00:11:14 UTC (rev 3745) @@ -25,8 +25,14 @@ package org.hyperic.hq.ui.action.resource.platform.autodiscovery; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; @@ -37,12 +43,10 @@ import org.hyperic.hq.appdef.shared.ServerTypeValue; import org.hyperic.hq.autoinventory.ScanConfiguration; import org.hyperic.hq.autoinventory.ScanMethod; -import org.hyperic.hq.autoinventory.ScanStateCore; import org.hyperic.hq.autoinventory.ServerSignature; import org.hyperic.hq.bizapp.shared.AIBoss; import org.hyperic.hq.bizapp.shared.AppdefBoss; import org.hyperic.hq.common.DuplicateObjectException; -import org.hyperic.hq.scheduler.ScheduleValue; import org.hyperic.hq.scheduler.ScheduleWillNeverFireException; import org.hyperic.hq.ui.Constants; import org.hyperic.hq.ui.action.BaseAction; @@ -53,13 +57,6 @@ import org.hyperic.util.config.ConfigResponse; import org.hyperic.util.pager.PageControl; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.HashMap; -import java.util.Map; -import java.util.List; - /** * Action class which saves an auto-discovery. The autodiscovery * can be an new/edit auto-discovery. @@ -86,17 +83,11 @@ Integer platformId = newForm.getRid(); Integer platformType = newForm.getType(); - Integer sid = newForm.getSid(); HashMap forwardParams = new HashMap(3); forwardParams.put(Constants.RESOURCE_PARAM, platformId); forwardParams.put(Constants.RESOURCE_TYPE_ID_PARAM, platformType ); - // Bug #7109, save the ai schedule id for edit ai schedule. needed - // when the user clicks on the reset button. - if (sid != null && sid.intValue() > 0) - forwardParams.put(Constants.SCHEDULE_PARAM, sid ); - ActionForward forward = checkSubmit(request, mapping, form, forwardParams, YES_RETURN_PATH); @@ -186,7 +177,6 @@ AppdefBoss boss = ContextUtils.getAppdefBoss(ctx); AIBoss aiboss = ContextUtils.getAIBoss(ctx); int sessionId = RequestUtils.getSessionIdInt(request); - Integer scheduleId = newForm.getSid(); // update the ScanConfiguration from the form obect List stValues = @@ -221,37 +211,16 @@ } scanConfig.setServerSignatures(serverDetectorArray); - // probably need to add a new scan and remove the old one in - // one transaction. - removeAISchedule(aiboss, sessionId, scheduleId); - - if (newForm.getIsNow()) { - aiboss.startScan(sessionId, - pValue.getId().intValue(), - scanConfig.getCore(), - null, null, /* No scanName or scanDesc for - immediate, one-time scans */ - null); - - waitForScanStart(sessionId, aiboss, pValue.getId().intValue()); - } else { - ScheduleValue val = newForm.createSchedule(); - aiboss.startScan(sessionId, - pValue.getId().intValue(), - scanConfig.getCore(), - newForm.getName(), - newForm.getDescription(), - val); - } + aiboss.startScan(sessionId, + pValue.getId().intValue(), + scanConfig.getCore(), + null, null, /* No scanName or scanDesc for + immediate, one-time scans */ + null); + + waitForScanStart(sessionId, aiboss, pValue.getId().intValue()); } - /** - * removes a AIScheduleValue object if new - */ - protected void removeAISchedule(AIBoss aiboss, - int sessionId, Integer sid) - throws Exception {} - private void waitForScanStart(int sessionId, AIBoss boss, int platformId) throws Exception { Thread.sleep(2000); Modified: trunk/src/org/hyperic/hq/ui/action/resource/platform/autodiscovery/PlatformAutoDiscoveryForm.java =================================================================== --- trunk/src/org/hyperic/hq/ui/action/resource/platform/autodiscovery/PlatformAutoDiscoveryForm.java 2007-03-13 22:59:04 UTC (rev 3744) +++ trunk/src/org/hyperic/hq/ui/action/resource/platform/autodiscovery/PlatformAutoDiscoveryForm.java 2007-03-14 00:11:14 UTC (rev 3745) @@ -34,6 +34,11 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import org.apache.commons.collections.CollectionUtils; +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.util.ImageButtonBean; +import org.apache.struts.util.LabelValueBean; import org.hyperic.hq.appdef.shared.AppdefResourceTypeValue; import org.hyperic.hq.appdef.shared.ServerTypeValue; import org.hyperic.hq.common.SystemException; @@ -46,13 +51,6 @@ import org.hyperic.util.config.InvalidOptionException; import org.hyperic.util.config.InvalidOptionValueException; -import org.apache.commons.collections.CollectionUtils; -import org.apache.struts.action.ActionError; -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.util.ImageButtonBean; -import org.apache.struts.util.LabelValueBean; - public class PlatformAutoDiscoveryForm extends ResourceForm { /** @@ -73,10 +71,6 @@ private ImageButtonBean scheduleTypeChange; - /** - * schedule id - */ - private Integer sid; private String scanMethod; //-------------------------------------constructors @@ -199,9 +193,6 @@ this.serverTypesLB = serverTypesLB; } - public Integer getSid() { return sid; } - public void setSid(Integer integer) { sid = integer; } - /** * This validate method tries to * @@ -239,16 +230,6 @@ List configs = BizappUtils.buildLoadConfigOptions(schema, newResponse ); this.configOptions = configs; } - - if (!getIsNow()) // check to see if name has been set - { - if (scanName == null || scanName.equalsIgnoreCase("")) - errors.add("name", new ActionError("resource.common.inventory.error.NameIsRequired")); - - // Make sure that the description is not too long, just cut it - if (scanDesc != null && scanDesc.length() > 200) - scanDesc = scanDesc.substring(0, 199); - } } if (errors != null && !errors.isEmpty() ) Modified: trunk/web/WEB-INF/classes/ApplicationResources.properties =================================================================== --- trunk/web/WEB-INF/classes/ApplicationResources.properties 2007-03-13 22:59:04 UTC (rev 3744) +++ trunk/web/WEB-INF/classes/ApplicationResources.properties 2007-03-14 00:11:14 UTC (rev 3745) @@ -1479,10 +1479,10 @@ resource.autodiscovery.autoDiscoveryProperties.DateCompleted=Date Completed: resource.autodiscovery.AutoDiscoveryHeaderTab=Quick Auto-Discovery Scan -resource.autodiscovery.AutoDiscoveryHeader.windows=Click 'OK' to start an immediate system scan. This will include a scan of the Windows registry and process table.<br>If you also want to perform a filesystem scan or if you'd like to schedule a recurring scan, fill out the remainder of the form below. -resource.autodiscovery.AutoDiscoveryHeader.unix=Click 'OK' to start an immediate system scan. This will include a scan of the system process-table.<br>If you also want to perform a filesystem scan or if you'd like to schedule a recurring scan, fill out the remainder of the form below. -resource.autodiscovery.AutoDiscoveryHeader.windows.AIonly=Click 'OK' to start an immediate system scan. This will include a scan of the Windows registry and process table.<br>If you also want to perform a filesystem scan, fill out the remainder of the form below. -resource.autodiscovery.AutoDiscoveryHeader.unix.AIonly=Click 'OK' to start an immediate system scan. This will include a scan of the system process-table.<br>If you also want to perform a filesystem scan, fill out the remainder of the form below. +resource.autodiscovery.AutoDiscoveryHeader.windows=Click 'OK' to start an immediate system scan on all resource types. This will include a scan of the Windows registry and process table.<br>If you also want to perform a filesystem scan or if you'd like to limit the resource types to be discovered, fill out the remainder of the form below. +resource.autodiscovery.AutoDiscoveryHeader.unix=Click 'OK' to start an immediate system scan on all resource types. This will include a scan of the system process-table.<br>If you also want to perform a filesystem scan or if you'd like to limit the resource types to be discovered, fill out the remainder of the form below. +resource.autodiscovery.AutoDiscoveryHeader.windows.AIonly=Click 'OK' to start an immediate system scan on all resource types. This will include a scan of the Windows registry and process table.<br>If you also want to perform a filesystem scan, fill out the remainder of the form below. +resource.autodiscovery.AutoDiscoveryHeader.unix.AIonly=Click 'OK' to start an immediate system scan on all resource types. This will include a scan of the system process-table.<br>If you also want to perform a filesystem scan, fill out the remainder of the form below. resource.autodiscovery.scan.NoScanConfig=This scan method does not have any scan properties. resource.autodiscovery.ScanTab=Extended Filesystem Scan Configuration Modified: trunk/web/resource/platform/autodiscovery/NewAutoDiscovery.jsp =================================================================== --- trunk/web/resource/platform/autodiscovery/NewAutoDiscovery.jsp 2007-03-13 22:59:04 UTC (rev 3744) +++ trunk/web/resource/platform/autodiscovery/NewAutoDiscovery.jsp 2007-03-14 00:11:14 UTC (rev 3745) @@ -61,13 +61,6 @@ </tiles:insert> <br> -<!-- SCHEDULE ACTION PROPERTIES --> -<tiles:insert page="/resource/platform/autodiscovery/AutoDiscoveryPropertiesForm.jsp"/> - <br> -<c:if test="${not onlyAIplatform}"> - <tiles:insert definition=".schedule"/> -</c:if> - <!-- FORM BUTTONS --> <tiles:insert definition=".form.buttons"/> |