Retrieve the given <code>{@link org.quartz.triggers.Trigger}</code>.

@return The desired <code>Trigger</code>, or null if there is no match.
176487
@Override
  public OperableTrigger retrieveTrigger(String triggerKey) {

    synchronized (lock) {
      TriggerWrapper tw = wrappedTriggersByKey.get(triggerKey);

      return (tw != null) ? (OperableTrigger) tw.getTrigger().clone() : null;
    }
  }
822890
public ICommonsList <? extends ITrigger> getTriggersOfJob (final JobKey jobKey) throws SchedulerException
  {
    validateState ();

    return m_aResources.getJobStore ().getTriggersForJob (jobKey);
  }
139232
public <T extends Notification> T getFromQueue() {
    int batchSize = 1;
    List<NotificationQueueDto> notificationDtos = dbClient.notificationQueueDao().selectOldest(batchSize);
    if (notificationDtos.isEmpty()) {
      return null;
    }
    dbClient.notificationQueueDao().delete(notificationDtos);

    return convertToNotification(notificationDtos);
  }
502300
public Trigger<? super S> getDeleteTrigger() {
        ForDelete<S> forDelete = mForDelete;
        return forDelete.isEmpty() ? null : forDelete;
    }
169551
@Override
    public List<OperableTrigger> getTriggersForJob(final JobKey jobKey) throws JobPersistenceException {
        return doWithLock(new LockCallback<List<OperableTrigger>>() {
            @Override
            public List<OperableTrigger> doWithLock(JedisCommands jedis) throws JobPersistenceException {
                return storage.getTriggersForJob(jobKey, jedis);
            }
        }, "Could not retrieve triggers for job.");
    }
522258
public static <T, W extends Window> PurgingTrigger<T, W> of(Trigger<T, W> nestedTrigger) {
		return new PurgingTrigger<>(nestedTrigger);
	}
437234
@Override
  public OperableTrigger instantiate() {

    SimpleTriggerImpl st = new SimpleTriggerImpl();
    st.setRepeatInterval(interval);
    st.setRepeatCount(repeatCount);
    st.setMisfireInstruction(misfireInstruction);
    return st;
  }
331025
public static final AlarmManager getAlarmManager()
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "getAlarmManager");
        if (tc.isEntryEnabled())
            Tr.exit(tc, "getAlarmManager", _alarmManager);
        return _alarmManager;
    }
106420
@Override
    public Trigger.TriggerState getTriggerState(final TriggerKey triggerKey) throws JobPersistenceException {
        return doWithLock(new LockCallback<Trigger.TriggerState>() {
            @Override
            public Trigger.TriggerState doWithLock(JedisCommands jedis) throws JobPersistenceException {
                return storage.getTriggerState(triggerKey, jedis);
            }
        }, "Could not retrieve trigger state.");
    }
133258
public Stamp getStamp() {
    checkClosed();

    TimeRequest tr = new TimeRequest();
    try {
      queue.put(tr);
      int timeout = env.getConfiguration().getConnectionRetryTimeout();
      if (timeout < 0) {
        long waitPeriod = 1;
        long waitTotal = 0;
        while (!tr.cdl.await(waitPeriod, TimeUnit.SECONDS)) {
          checkClosed();
          waitTotal += waitPeriod;
          if (waitPeriod < MAX_ORACLE_WAIT_PERIOD) {
            waitPeriod *= 2;
          }
          log.warn(
              "Waiting for timestamp from Oracle. Is it running? Client has waited a total of {}s and will retry in {}s",
              waitTotal, waitPeriod);
        }
      } else if (!tr.cdl.await(timeout, TimeUnit.MILLISECONDS)) {
        throw new FluoException("Timed out (after " + timeout
            + "ms) trying to retrieve timestamp from Oracle.  Is the Oracle running?");
      }
    } catch (InterruptedException e) {
      throw new FluoException("Interrupted while retrieving timestamp from Oracle", e);
    }
    return tr.stampRef.get();
  }
1084910
@Override
  public List<OperableTrigger> acquireNextTriggers(
      long noLaterThan, int maxCount, long timeWindow) {

    synchronized (lock) {
      List<OperableTrigger> result = new ArrayList<OperableTrigger>();

      while (true) {
        TriggerWrapper tw;

        try {
          tw = timeWrappedTriggers.first();
          if (tw == null) {
            return result;
          }
          timeWrappedTriggers.remove(tw);
        } catch (java.util.NoSuchElementException nsee) {
          return result;
        }

        if (tw.trigger.getNextFireTime() == null) {
          continue;
        }

        if (applyMisfire(tw)) {
          if (tw.trigger.getNextFireTime() != null) {
            timeWrappedTriggers.add(tw);
          }
          continue;
        }

        if (tw.getTrigger().getNextFireTime().getTime() > noLaterThan + timeWindow) {
          timeWrappedTriggers.add(tw);
          return result;
        }

        tw.state = TriggerWrapper.STATE_ACQUIRED;

        tw.trigger.setFireInstanceId(getFiredTriggerRecordId());
        OperableTrigger trig = (OperableTrigger) tw.trigger.clone();
        result.add(trig);

        if (result.size() == maxCount) {
          return result;
        }
      }
    }
  }
410556
@Override
    public void releaseAcquiredTrigger(final OperableTrigger trigger) {
        try {
            doWithLock(new LockCallbackWithoutResult() {
                @Override
                public Void doWithLock(JedisCommands jedis) throws JobPersistenceException {
                    storage.releaseAcquiredTrigger(trigger, jedis);
                    return null;
                }
            }, "Could not release acquired trigger.");
        } catch (JobPersistenceException e) {
            logger.error("Could not release acquired trigger.", e);
        }
    }
1094059
@CheckForNull
    public static <T extends Trigger> T triggerFrom(Item item, Class<T> tClass) {
        if (item instanceof ParameterizedJobMixIn.ParameterizedJob) {
            ParameterizedJobMixIn.ParameterizedJob pJob = (ParameterizedJobMixIn.ParameterizedJob) item;

            for (Trigger candidate : pJob.getTriggers().values()) {
                if (tClass.isInstance(candidate)) {
                    return tClass.cast(candidate);
                }
            }
        }
        return null;
    }
1016958
TriggerDef getTrigger(String name) {

        for (int i = triggerList.length - 1; i >= 0; i--) {
            if (triggerList[i].name.name.equals(name)) {
                return triggerList[i];
            }
        }

        return null;
    }
602035
@Override
    public Collection<String> resumeTriggers(GroupMatcher<TriggerKey> matcher, JedisCluster jedis) throws JobPersistenceException {
        Set<String> resumedTriggerGroups = new HashSet<>();
        if (matcher.getCompareWithOperator() == StringMatcher.StringOperatorName.EQUALS) {
            final String triggerGroupSetKey = redisSchema.triggerGroupSetKey(new TriggerKey("", matcher.getCompareToValue()));
            jedis.srem(redisSchema.pausedJobGroupsSet(), triggerGroupSetKey);
            Set<String> triggerHashKeysResponse = jedis.smembers(triggerGroupSetKey);
            for (String triggerHashKey : triggerHashKeysResponse) {
                OperableTrigger trigger = retrieveTrigger(redisSchema.triggerKey(triggerHashKey), jedis);
                resumeTrigger(trigger.getKey(), jedis);
                resumedTriggerGroups.add(trigger.getKey().getGroup());
            }
        } else {
            for (final String triggerGroupSetKey : jedis.smembers(redisSchema.triggerGroupsSet())) {
                if (matcher.getCompareWithOperator().evaluate(redisSchema.triggerGroup(triggerGroupSetKey), matcher.getCompareToValue())) {
                    resumedTriggerGroups.addAll(resumeTriggers(GroupMatcher.triggerGroupEquals(redisSchema.triggerGroup(triggerGroupSetKey)), jedis));
                }
            }
        }
        return resumedTriggerGroups;
    }
611773
public Trigger getCronTrigger(String cronExpression) {
    CronScheduleBuilder cronScheduleBuilder = null;
    Trigger cronTrigger = null;
    try {
      cronScheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
      cronScheduleBuilder.withMisfireHandlingInstructionFireAndProceed();
      TriggerBuilder<Trigger> cronTtriggerBuilder = TriggerBuilder.newTrigger();
      cronTtriggerBuilder.withSchedule(cronScheduleBuilder);
      cronTrigger = cronTtriggerBuilder.build();
    } catch (Exception pe) {
      logger.error("Error occurred while builiding the cronTrigger : " + pe.getMessage(), pe);
    }
    return cronTrigger;
  }
727014
public Object get() {
		Object result = null;
		if (over)
			return eventResult;
		try {
			boolean runOk = (Boolean) futureTask.get(timeoutforeturnResult, TimeUnit.MILLISECONDS);
			if (runOk) {
				result = this.eventResult;
			}
			over = true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}