org.quartz.JobKey Java Examples

The following examples show how to use org.quartz.JobKey. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SchedulerTool.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
/**
 * This method runs the current job only once, right now
 * @return int 0 if it's not running, 1 if it is, 2 if there is an error
 */
public int getSelectedJobRunning()
{
   Scheduler scheduler = schedulerManager.getScheduler();
   if (scheduler == null)
   {
     log.error("Scheduler is down!");
     return 2;
   }
   try
   {
      List<JobExecutionContext> executingJobs = scheduler.getCurrentlyExecutingJobs();
      JobKey selected = selectedJobDetailWrapper.getJobDetail().getKey();

      for (JobExecutionContext jobExecutionContext : executingJobs) {
         if(selected.equals(jobExecutionContext.getJobDetail().getKey()) )
            return 1;
      }
      return 0;
   }
   catch (Exception e)
   {
     log.error("Failed to trigger job now", e);
     return 2;
   }
}
 
Example #2
Source File: CronService.java    From aion-germany with GNU General Public License v3.0 6 votes vote down vote up
public void schedule(Runnable r, String cronExpression, boolean longRunning) {
	try {
		JobDataMap jdm = new JobDataMap();
		jdm.put(RunnableRunner.KEY_RUNNABLE_OBJECT, r);
		jdm.put(RunnableRunner.KEY_PROPERTY_IS_LONGRUNNING_TASK, longRunning);
		jdm.put(RunnableRunner.KEY_CRON_EXPRESSION, cronExpression);

		String jobId = "Started at ms" + System.currentTimeMillis() + "; ns" + System.nanoTime();
		JobKey jobKey = new JobKey("JobKey:" + jobId);
		JobDetail jobDetail = JobBuilder.newJob(runnableRunner).usingJobData(jdm).withIdentity(jobKey).build();

		CronScheduleBuilder csb = CronScheduleBuilder.cronSchedule(cronExpression);
		CronTrigger trigger = TriggerBuilder.newTrigger().withSchedule(csb).build();

		scheduler.scheduleJob(jobDetail, trigger);
	} catch (Exception e) {
		throw new CronServiceException("Failed to start job", e);
	}
}
 
Example #3
Source File: AbstractQuartzScheduler.java    From deltaspike with Apache License 2.0 6 votes vote down vote up
private Trigger createTrigger(Scheduled scheduled, JobKey jobKey, String cronExpression) throws SchedulerException
{
    UUID triggerKey = UUID.randomUUID();

    if (!scheduled.cronExpression().endsWith(cronExpression))
    {
        createExpressionObserverJob(jobKey, triggerKey, scheduled.cronExpression(), cronExpression);
    }

    Trigger trigger = TriggerBuilder.newTrigger()
            .forJob(jobKey)
            .withIdentity(triggerKey.toString())
            .withSchedule(CronScheduleBuilder.cronSchedule(cronExpression))
            .build();
    return trigger;
}
 
Example #4
Source File: QuartzSchedulerSPI.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Returns all tasks for the {@link #GROUP_NAME} group, which also have attached job-listeners.
 */
private Map<JobKey, QuartzTaskInfo> allTasks() throws SchedulerException {
  try (TcclBlock tccl = TcclBlock.begin(this)) {
    Map<JobKey, QuartzTaskInfo> result = new HashMap<>();

    Set<JobKey> jobKeys = scheduler.getJobKeys(jobGroupEquals(GROUP_NAME));
    for (JobKey jobKey : jobKeys) {
      QuartzTaskJobListener listener = findJobListener(jobKey);
      if (listener != null) {
        result.put(jobKey, listener.getTaskInfo());
      }
      else {
        // TODO: Sort out if this is normal or edge-case indicative of a bug or not
        log.debug("Job missing listener; omitting from results: {}", jobKey);
      }
    }

    return result;
  }
}
 
Example #5
Source File: QuartzScheduler.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * <p>
 * Delete the identified <code>Job</code> from the Scheduler - and any
 * associated <code>Trigger</code>s.
 * </p>
 * 
 * @return true if the Job was found and deleted.
 * @throws SchedulerException
 *           if there is an internal Scheduler error.
 */
public boolean deleteJob(JobKey jobKey) throws SchedulerException {
    validateState();

    boolean result = false;
    
    List<? extends Trigger> triggers = getTriggersOfJob(jobKey);
    for (Trigger trigger : triggers) {
        if (!unscheduleJob(trigger.getKey())) {
            StringBuilder sb = new StringBuilder().append(
                    "Unable to unschedule trigger [").append(
                    trigger.getKey()).append("] while deleting job [")
                    .append(jobKey).append(
                            "]");
            throw new SchedulerException(sb.toString());
        }
        result = true;
    }

    result = resources.getJobStore().removeJob(jobKey) || result;
    if (result) {
        notifySchedulerThread(0L);
        notifySchedulerListenersJobDeleted(jobKey);
    }
    return result;
}
 
Example #6
Source File: StdJDBCDelegate.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * <p>
 * Update the states of all triggers associated with the given job.
 * </p>
 * 
 * @param conn
 *          the DB Connection
 * @param state
 *          the new state for the triggers
 * @return the number of rows updated
 */
public int updateTriggerStatesForJob(Connection conn, JobKey jobKey,
        String state) throws SQLException {
    PreparedStatement ps = null;

    try {
        ps = conn.prepareStatement(rtp(UPDATE_JOB_TRIGGER_STATES));
        ps.setString(1, state);
        ps.setString(2, jobKey.getName());
        ps.setString(3, jobKey.getGroup());

        return ps.executeUpdate();
    } finally {
        closeStatement(ps);
    }
}
 
Example #7
Source File: BatchJobOperatorImpl.java    From griffin with Apache License 2.0 6 votes vote down vote up
/**
 * all states: BLOCKED  COMPLETE ERROR NONE  NORMAL   PAUSED
 * to start states: PAUSED
 * to stop states: BLOCKED   NORMAL
 *
 * @param job streaming job
 */
@Override
public void start(AbstractJob job) {
    String name = job.getName();
    String group = job.getGroup();
    TriggerState state = getTriggerState(name, group);
    if (state == null) {
        throw new GriffinException.BadRequestException(
            JOB_IS_NOT_SCHEDULED);
    }
    /* If job is not in paused state,we can't start it
    as it may be RUNNING.*/
    if (state != PAUSED) {
        throw new GriffinException.BadRequestException
            (JOB_IS_NOT_IN_PAUSED_STATUS);
    }
    JobKey jobKey = jobKey(name, group);
    try {
        factory.getScheduler().resumeJob(jobKey);
    } catch (SchedulerException e) {
        throw new GriffinException.ServiceException(
            "Failed to start job.", e);
    }
}
 
Example #8
Source File: JobServiceImpl.java    From spring-boot-quartz-demo with MIT License 6 votes vote down vote up
/**
 * Start a job now
 */
@Override
public boolean startJobNow(String jobName) {
	System.out.println("Request received for starting job now.");

	String jobKey = jobName;
	String groupKey = "SampleGroup";

	JobKey jKey = new JobKey(jobKey, groupKey); 
	System.out.println("Parameters received for starting job now : jobKey :"+jobKey);
	try {
		schedulerFactoryBean.getScheduler().triggerJob(jKey);
		System.out.println("Job with jobKey :"+jobKey+ " started now succesfully.");
		return true;
	} catch (SchedulerException e) {
		System.out.println("SchedulerException while starting job now with key :"+jobKey+ " message :"+e.getMessage());
		e.printStackTrace();
		return false;
	}		
}
 
Example #9
Source File: JobServiceImpl.java    From spring-boot-quartz-demo with MIT License 6 votes vote down vote up
/**
 * Delete the identified Job from the Scheduler - and any associated Triggers.
 */
@Override
public boolean deleteJob(String jobName) {
	System.out.println("Request received for deleting job.");

	String jobKey = jobName;
	String groupKey = "SampleGroup";

	JobKey jkey = new JobKey(jobKey, groupKey); 
	System.out.println("Parameters received for deleting job : jobKey :"+jobKey);

	try {
		boolean status = schedulerFactoryBean.getScheduler().deleteJob(jkey);
		System.out.println("Job with jobKey :"+jobKey+ " deleted with status :"+status);
		return status;
	} catch (SchedulerException e) {
		System.out.println("SchedulerException while deleting job with key :"+jobKey + " message :"+e.getMessage());
		e.printStackTrace();
		return false;
	}
}
 
Example #10
Source File: EntityMocksHelper.java    From griffin with Apache License 2.0 6 votes vote down vote up
public static JobDetailImpl createJobDetail(
    String measureJson,
    String predicatesJson) {
    JobDetailImpl jobDetail = new JobDetailImpl();
    JobKey jobKey = new JobKey("name", "group");
    jobDetail.setKey(jobKey);
    JobDataMap jobDataMap = new JobDataMap();
    jobDataMap.put(MEASURE_KEY, measureJson);
    jobDataMap.put(PREDICATES_KEY, predicatesJson);
    jobDataMap.put(JOB_NAME, "jobName");
    jobDataMap.put("jobName", "jobName");
    jobDataMap.put(PREDICATE_JOB_NAME, "predicateJobName");
    jobDataMap.put(GRIFFIN_JOB_ID, 1L);
    jobDetail.setJobDataMap(jobDataMap);
    return jobDetail;
}
 
Example #11
Source File: CronJobManagerImpl.java    From attic-aurora with Apache License 2.0 6 votes vote down vote up
@Override
public Map<IJobKey, CrontabEntry> getScheduledJobs() {
  // NOTE: no synchronization is needed here since this is just a dump of internal quartz state
  // for debugging.
  ImmutableMap.Builder<IJobKey, CrontabEntry> scheduledJobs = ImmutableMap.builder();
  try {
    for (JobKey jobKey : scheduler.getJobKeys(GroupMatcher.anyGroup())) {
      // The quartz API allows jobs to have multiple triggers. We don't use that feature but
      // we're defensive here since this function is used for debugging.
      Optional<CronTrigger> trigger = FluentIterable.from(scheduler.getTriggersOfJob(jobKey))
          .filter(CronTrigger.class)
          .first()
          .toJavaUtil();
      if (trigger.isPresent()) {
        scheduledJobs.put(
            Quartz.auroraJobKey(jobKey),
            Quartz.crontabEntry(trigger.get()));
      }
    }
  } catch (SchedulerException e) {
    throw new RuntimeException(e);
  }
  return scheduledJobs.build();
}
 
Example #12
Source File: ShowScheduler.java    From iaf with Apache License 2.0 6 votes vote down vote up
@GET
@RolesAllowed({"IbisObserver", "IbisDataAdmin", "IbisAdmin", "IbisTester"})
@Path("/schedules/{groupName}/job/{jobName}")
@Relation("schedules")
@Produces(MediaType.APPLICATION_JSON)
public Response getSchedule(@PathParam("jobName") String jobName, @PathParam("groupName") String groupName) throws ApiException {
	Map<String, Object> returnMap = new HashMap<String, Object>();
	JobKey jobKey = JobKey.jobKey(jobName, groupName);

	try {
		returnMap = getJobData(jobKey, true);
	} catch (SchedulerException e) {
		throw new ApiException(e);
	}
	return Response.status(Response.Status.OK).entity(returnMap).build();
}
 
Example #13
Source File: SiteScheduledJobsController.java    From engine with GNU General Public License v3.0 6 votes vote down vote up
@GetMapping(URL_LIST)
@SuppressWarnings("unchecked")
public List<Map<String, String>> listScheduledJobs() throws SchedulerException {
    List<Map<String, String>> jobs = new LinkedList<>();
    SiteContext siteContext = SiteContext.getCurrent();
    Scheduler scheduler = siteContext.getScheduler();
    if(scheduler != null) {
        List<String> groups = scheduler.getJobGroupNames();
        for (String group : groups) {
            Set<JobKey> keys = scheduler.getJobKeys(GroupMatcher.jobGroupEquals(group));
            for (JobKey key : keys) {
                List<Trigger> triggers = (List<Trigger>)scheduler.getTriggersOfJob(key);
                Map<String, String> job = new HashMap<>();
                job.put("name", key.getName());
                job.put("nextFireTime", triggers.get(0).getNextFireTime().toInstant().toString());
                jobs.add(job);
            }
        }
    }
    return jobs;
}
 
Example #14
Source File: RemoteMBeanScheduler.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * <p>
 * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
 * passing the <code>SchedulingContext</code> associated with this
 * instance.
 * </p>
 */
public void resumeJobs(GroupMatcher<JobKey> matcher) throws SchedulerException {
    String operation = null;
    switch (matcher.getCompareWithOperator()) {
        case EQUALS:
            operation = "resumeJobGroup";
            break;
        case STARTS_WITH:
            operation = "resumeJobsStartingWith";
            break;
        case ENDS_WITH:
            operation = "resumeJobsEndingWith";
            break;
        case CONTAINS:
            operation = "resumeJobsContaining";
        case ANYTHING:
            operation = "resumeJobsAll";
    }

    invoke(
            operation,
            new Object[] { matcher.getCompareToValue() },
            new String[] { String.class.getName() });
}
 
Example #15
Source File: QuartzSchedulerMBeanImpl.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public TabularData getAllJobDetails() throws Exception {
    try {
        List<JobDetail> detailList = new ArrayList<JobDetail>();
        for (String jobGroupName : scheduler.getJobGroupNames()) {
            for (JobKey jobKey : scheduler.getJobKeys(GroupMatcher.jobGroupEquals(jobGroupName))) {
                detailList.add(scheduler.getJobDetail(jobKey));
            }
        }
        return JobDetailSupport.toTabularData(detailList.toArray(new JobDetail[detailList.size()]));
    } catch (Exception e) {
        throw newPlainException(e);
    }
}
 
Example #16
Source File: QuartzScheduler.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public void notifySchedulerListenersResumedJob(JobKey key) {
    // build a list of all scheduler listeners that are to be notified...
    List<SchedulerListener> schedListeners = buildSchedulerListenerList();

    // notify all scheduler listeners
    for(SchedulerListener sl: schedListeners) {
        try {
            sl.jobResumed(key);
        } catch (Exception e) {
            getLog().error(
                    "Error while notifying SchedulerListener of resumed job: "
                            + key, e);
        }
    }
}
 
Example #17
Source File: SchedulerService.java    From jolie with GNU Lesser General Public License v2.1 5 votes vote down vote up
@RequestResponse
public Value deleteCronJob( Value request ) {
	String jobName = request.getFirstChild( "jobName" ).strValue();
	String groupName = request.getFirstChild( "groupName" ).strValue();
	try {
		if( scheduler.checkExists( TriggerKey.triggerKey( jobName, groupName ) ) ) {
			scheduler.unscheduleJob( TriggerKey.triggerKey( jobName, groupName ) );
			scheduler.deleteJob( JobKey.jobKey( jobName, groupName ) );
		}
	} catch( SchedulerException ex ) {
		Logger.getLogger( SchedulerService.class.getName() ).log( Level.SEVERE, null, ex );
	}
	return Value.create();
}
 
Example #18
Source File: AppApplicationImpl.java    From timer with Apache License 2.0 5 votes vote down vote up
@Override
public void register(String appName, String address) {
    //LOGGER.info("Application registering:appName[{}], address[{}]", appName, address);
    List<String> addressList = appDomain.getAddressListByName(appName, Boolean.TRUE);
    AppPO appPO = appDomain.getAppInfo(appName, address);
    if (appPO == null) {
        appPO = new AppPO(appName, address, Boolean.TRUE);
        appDomain.addNewApp(appPO);
    } else if (!appPO.getStatus()) {
        changeAppStatus(appPO.getId(), Boolean.TRUE);
    } else {
        appDomain.updateActiveTime(appName, address);
    }
    //LOGGER.info("Application registered");
    if (CollectionUtils.isEmpty(addressList)) {
        List<JobPO> jobPOS = jobDomain.getJobListByAppName(appName);
        try {
            if (CollectionUtils.isNotEmpty(jobPOS)) {
                for (JobPO jobPO : jobPOS) {
                    quartzScheduler.resumeJob(JobKey.jobKey(jobPO.getJobName(), appName));
                }
            }
        } catch (SchedulerException e) {
            e.printStackTrace();
        }
    }
}
 
Example #19
Source File: QuartzScheduler.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <p>
 * Pause the <code>{@link org.quartz.JobDetail}</code> with the given
 * name - by pausing all of its current <code>Trigger</code>s.
 * </p>
 *  
 */
public void pauseJob(JobKey jobKey) throws SchedulerException {
    validateState();

    resources.getJobStore().pauseJob(jobKey);
    notifySchedulerThread(0L);
    notifySchedulerListenersPausedJob(jobKey);
}
 
Example #20
Source File: TaskInnerServiceSMOImpl.java    From MicroCommunity with Apache License 2.0 5 votes vote down vote up
/**
 * 停止任务
 *
 * @param taskDto
 * @return
 */
public int stopTask(@RequestBody TaskDto taskDto) {

    try {
        String jobName = prefixJobName + taskDto.getTaskId();

        String triggerName = prefixJobName + taskDto.getTaskId();

        TriggerKey triggerKey = TriggerKey.triggerKey(jobName, TaskSystemJob.JOB_GROUP_NAME);
        // 停止触发器
        scheduler.pauseTrigger(triggerKey);
        // 移除触发器
        scheduler.unscheduleJob(triggerKey);

        JobKey jobKey = new JobKey(jobName, TaskSystemJob.JOB_GROUP_NAME);
        // 删除任务
        scheduler.deleteJob(jobKey);

        Map paramIn = new HashMap();
        paramIn.put("taskId", taskDto.getTaskId());
        paramIn.put("state", "001");
        paramIn.put("statusCd", "0");
        taskServiceDaoImpl.updateTaskInfoInstance(paramIn);

    } catch (Exception e) {
        logger.error("启动侦听失败", e);
        return 0;
    }
    return 1;
}
 
Example #21
Source File: InstanceDetection.java    From uflo with Apache License 2.0 5 votes vote down vote up
private JobDetailImpl initJobDetail(String currentInstanceName){
	String clusterJobInstanceNames[]=instanceNames.split(",");
	SessionFactory sessionFactory=EnvironmentUtils.getEnvironment().getSessionFactory();
	JobDetailImpl jobDetail=new DetectionJobDetail(sessionFactory,currentInstanceName,clusterJobInstanceNames,schedulerService);
	jobDetail.setKey(new JobKey("UfloDaemonJobDetail"));
	jobDetail.setName("UfloDaemonDetectionJobDetail");
	return jobDetail;
}
 
Example #22
Source File: QuartzJobServiceImpl.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
 * 编辑&启停定时任务
 * @throws SchedulerException 
 */
@Override
public boolean editAndScheduleJob(QuartzJob quartzJob) throws SchedulerException {
	if (CommonConstant.STATUS_NORMAL.equals(quartzJob.getStatus())) {
		schedulerDelete(quartzJob.getJobClassName().trim());
		schedulerAdd(quartzJob.getJobClassName().trim(), quartzJob.getCronExpression().trim(), quartzJob.getParameter());
	}else{
		scheduler.pauseJob(JobKey.jobKey(quartzJob.getJobClassName().trim()));
	}
	return this.updateById(quartzJob);
}
 
Example #23
Source File: JobServiceImpl.java    From spring-boot-quartz-demo with MIT License 5 votes vote down vote up
/**
 * Pause a job
 */
@Override
public boolean pauseJob(String jobName) {
	System.out.println("Request received for pausing job.");

	String jobKey = jobName;
	String groupKey = "SampleGroup";
	JobKey jkey = new JobKey(jobKey, groupKey); 
	System.out.println("Parameters received for pausing job : jobKey :"+jobKey+ ", groupKey :"+groupKey);

	try {
		schedulerFactoryBean.getScheduler().pauseJob(jkey);
		System.out.println("Job with jobKey :"+jobKey+ " paused succesfully.");
		return true;
	} catch (SchedulerException e) {
		System.out.println("SchedulerException while pausing job with key :"+jobName + " message :"+e.getMessage());
		e.printStackTrace();
		return false;
	}
}
 
Example #24
Source File: ScheduleService.java    From elasticsearch-quartz with Apache License 2.0 5 votes vote down vote up
public void triggerJob(final JobKey jobKey, final JobDataMap data) {
    try {
        scheduler.triggerJob(jobKey, data);
    } catch (final SchedulerException e) {
        throw new QuartzSchedulerException(e);
    }
}
 
Example #25
Source File: ScheduleServiceImpl.java    From FoxBPM with Apache License 2.0 5 votes vote down vote up
public void suspendJob(String name, String group) {
	try {
		foxbpmScheduler.pauseJob(new JobKey(name, group));
	} catch (SchedulerException e) {
		throw new FoxBPMException("", e);
	}
}
 
Example #26
Source File: AbstractTerracottaJobStore.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean checkExists(final JobKey jobKey) throws JobPersistenceException {
  try {
    return realJobStore.checkExists(jobKey);
  } catch (RejoinException e) {
    throw new JobPersistenceException("Job existence check failed due to client rejoin", e);
  }
}
 
Example #27
Source File: BatchJobOperatorImpl.java    From griffin with Apache License 2.0 5 votes vote down vote up
public void deleteJob(String group, String name) throws SchedulerException {
    Scheduler scheduler = factory.getScheduler();
    JobKey jobKey = new JobKey(name, group);
    if (!scheduler.checkExists(jobKey)) {
        LOGGER.info("Job({},{}) does not exist.", jobKey.getGroup(), jobKey
            .getName());
        return;
    }
    scheduler.deleteJob(jobKey);

}
 
Example #28
Source File: RAMJobStore.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public boolean removeJobs(List<JobKey> jobKeys)
        throws JobPersistenceException {
    boolean allFound = true;

    synchronized (lock) {
        for(JobKey key: jobKeys)
            allFound = removeJob(key) && allFound;
    }

    return allFound;
}
 
Example #29
Source File: QuartzScheduler.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <p>
 * Pause all of the <code>{@link org.quartz.JobDetail}s</code> in the
 * matching groups - by pausing all of their <code>Trigger</code>s.
 * </p>
 *  
 */
public void pauseJobs(GroupMatcher<JobKey> groupMatcher)
    throws SchedulerException {
    validateState();

    if(groupMatcher == null) {
        groupMatcher = GroupMatcher.groupEquals(Scheduler.DEFAULT_GROUP);
    }
    
    Collection<String> pausedGroups = resources.getJobStore().pauseJobs(groupMatcher);
    notifySchedulerThread(0L);
    for (String pausedGroup : pausedGroups) {
        notifySchedulerListenersPausedJobs(pausedGroup);
    }
}
 
Example #30
Source File: JobServiceImpl.java    From spring-boot-quartz-demo with MIT License 5 votes vote down vote up
/**
 * Get the current state of job
 */
public String getJobState(String jobName) {
	System.out.println("JobServiceImpl.getJobState()");

	try {
		String groupKey = "SampleGroup";
		JobKey jobKey = new JobKey(jobName, groupKey);

		Scheduler scheduler = schedulerFactoryBean.getScheduler();
		JobDetail jobDetail = scheduler.getJobDetail(jobKey);

		List<? extends Trigger> triggers = scheduler.getTriggersOfJob(jobDetail.getKey());
		if(triggers != null && triggers.size() > 0){
			for (Trigger trigger : triggers) {
				TriggerState triggerState = scheduler.getTriggerState(trigger.getKey());

				if (TriggerState.PAUSED.equals(triggerState)) {
					return "PAUSED";
				}else if (TriggerState.BLOCKED.equals(triggerState)) {
					return "BLOCKED";
				}else if (TriggerState.COMPLETE.equals(triggerState)) {
					return "COMPLETE";
				}else if (TriggerState.ERROR.equals(triggerState)) {
					return "ERROR";
				}else if (TriggerState.NONE.equals(triggerState)) {
					return "NONE";
				}else if (TriggerState.NORMAL.equals(triggerState)) {
					return "SCHEDULED";
				}
			}
		}
	} catch (SchedulerException e) {
		System.out.println("SchedulerException while checking job with name and group exist:"+e.getMessage());
		e.printStackTrace();
	}
	return null;
}