/** * Constructor for creating a new job with all required parameters. * * <p> * * @param id the id of the job of <code>null</code> if a new id should be automatically generated * @param jobName the display name of the job * @param className the class name of the job, must be an instance of <code> * {@link I_CmsScheduledJob}</code> * @param context the OpenCms user context information to use when executing the job * @param cronExpression the cron expression for scheduling the job * @param reuseInstance indicates if the job class should be re-used * @param active indicates if the job should be active in the scheduler * @param parameters the job parameters */ public CmsScheduledJobInfo( String id, String jobName, String className, CmsContextInfo context, String cronExpression, boolean reuseInstance, boolean active, SortedMap<String, String> parameters) { m_frozen = false; setId(id); if (CmsStringUtil.isNotEmpty(jobName)) { // job name is optional, if not present class name will be used setJobName(jobName); } setClassName(className); setContextInfo(context); setCronExpression(cronExpression); setReuseInstance(reuseInstance); setActive(active); setParameters(parameters); }
/** * Clears the id of the job. * * <p>This is useful if you want to create a copy of a job without keeping the job id. Use <code> * {@link CmsScheduledJobInfo#clone()}</code> first to create the copy, and then clear the id of * the clone. * * <p> */ public void clearId() { setId(null); }