本文整理匯總了Java中org.quartz.Trigger.getEndTime方法的典型用法代碼示例。如果您正苦於以下問題:Java Trigger.getEndTime方法的具體用法?Java Trigger.getEndTime怎麽用?Java Trigger.getEndTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.quartz.Trigger
的用法示例。
在下文中一共展示了Trigger.getEndTime方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: toCompositeData
import org.quartz.Trigger; //導入方法依賴的package包/類
public static CompositeData toCompositeData(Trigger trigger) {
try {
return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
new Object[] {
trigger.getName(),
trigger.getGroup(),
trigger.getJobName(),
trigger.getJobGroup(),
trigger.getDescription(),
JobDataMapSupport.toTabularData(trigger
.getJobDataMap()), trigger.isVolatile(),
trigger.getCalendarName(),
trigger.getFireInstanceId(),
trigger.getMisfireInstruction(),
trigger.getPriority(), trigger.getStartTime(),
trigger.getEndTime(), trigger.getNextFireTime(),
trigger.getPreviousFireTime(),
trigger.getFinalFireTime() });
} catch (OpenDataException e) {
throw new RuntimeException(e);
}
}
示例2: toCompositeData
import org.quartz.Trigger; //導入方法依賴的package包/類
public static CompositeData toCompositeData(Trigger trigger) {
try {
return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
new Object[] {
trigger.getKey().getName(),
trigger.getKey().getGroup(),
trigger.getJobKey().getName(),
trigger.getJobKey().getGroup(),
trigger.getDescription(),
JobDataMapSupport.toTabularData(trigger
.getJobDataMap()),
trigger.getCalendarName(),
((OperableTrigger)trigger).getFireInstanceId(),
trigger.getMisfireInstruction(),
trigger.getPriority(), trigger.getStartTime(),
trigger.getEndTime(), trigger.getNextFireTime(),
trigger.getPreviousFireTime(),
trigger.getFinalFireTime() });
} catch (OpenDataException e) {
throw new RuntimeException(e);
}
}
示例3: insertTrigger
import org.quartz.Trigger; //導入方法依賴的package包/類
public int insertTrigger(Connection conn, Trigger trigger, String state,
JobDetail jobDetail) throws SQLException, IOException {
ByteArrayOutputStream baos = serializeJobData(trigger.getJobDataMap());
int len = baos.toByteArray().length;
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
PreparedStatement ps = null;
int insertResult = 0;
try {
ps = conn.prepareStatement(rtp(INSERT_TRIGGER));
ps.setString(1, trigger.getName());
ps.setString(2, trigger.getGroup());
ps.setString(3, trigger.getJobName());
ps.setString(4, trigger.getJobGroup());
setBoolean(ps, 5, trigger.isVolatile());
ps.setString(6, trigger.getDescription());
ps.setBigDecimal(7, new BigDecimal(String.valueOf(trigger
.getNextFireTime().getTime())));
long prevFireTime = -1;
if (trigger.getPreviousFireTime() != null) {
prevFireTime = trigger.getPreviousFireTime().getTime();
}
ps.setBigDecimal(8, new BigDecimal(String.valueOf(prevFireTime)));
ps.setString(9, state);
if (trigger instanceof SimpleTrigger && ((SimpleTrigger)trigger).hasAdditionalProperties() == false ) {
ps.setString(10, TTYPE_SIMPLE);
} else if (trigger instanceof CronTrigger && ((CronTrigger)trigger).hasAdditionalProperties() == false ) {
ps.setString(10, TTYPE_CRON);
} else {
ps.setString(10, TTYPE_BLOB);
}
ps.setBigDecimal(11, new BigDecimal(String.valueOf(trigger
.getStartTime().getTime())));
long endTime = 0;
if (trigger.getEndTime() != null) {
endTime = trigger.getEndTime().getTime();
}
ps.setBigDecimal(12, new BigDecimal(String.valueOf(endTime)));
ps.setString(13, trigger.getCalendarName());
ps.setInt(14, trigger.getMisfireInstruction());
ps.setBinaryStream(15, bais, len);
ps.setInt(16, trigger.getPriority());
insertResult = ps.executeUpdate();
} finally {
closeStatement(ps);
}
if (insertResult > 0) {
String[] trigListeners = trigger.getTriggerListenerNames();
for (int i = 0; trigListeners != null && i < trigListeners.length; i++) {
insertTriggerListener(conn, trigger, trigListeners[i]);
}
}
return insertResult;
}
示例4: updateTrigger
import org.quartz.Trigger; //導入方法依賴的package包/類
public int updateTrigger(Connection conn, Trigger trigger, String state,
JobDetail jobDetail) throws SQLException, IOException {
ByteArrayOutputStream baos = serializeJobData(trigger.getJobDataMap());
int len = baos.toByteArray().length;
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
PreparedStatement ps = null;
int insertResult = 0;
try {
ps = conn.prepareStatement(rtp(UPDATE_TRIGGER));
ps.setString(1, trigger.getJobName());
ps.setString(2, trigger.getJobGroup());
setBoolean(ps, 3, trigger.isVolatile());
ps.setString(4, trigger.getDescription());
long nextFireTime = -1;
if (trigger.getNextFireTime() != null) {
nextFireTime = trigger.getNextFireTime().getTime();
}
ps.setBigDecimal(5, new BigDecimal(String.valueOf(nextFireTime)));
long prevFireTime = -1;
if (trigger.getPreviousFireTime() != null) {
prevFireTime = trigger.getPreviousFireTime().getTime();
}
ps.setBigDecimal(6, new BigDecimal(String.valueOf(prevFireTime)));
ps.setString(7, state);
if (trigger instanceof SimpleTrigger && ((SimpleTrigger)trigger).hasAdditionalProperties() == false ) {
// updateSimpleTrigger(conn, (SimpleTrigger)trigger);
ps.setString(8, TTYPE_SIMPLE);
} else if (trigger instanceof CronTrigger && ((CronTrigger)trigger).hasAdditionalProperties() == false ) {
// updateCronTrigger(conn, (CronTrigger)trigger);
ps.setString(8, TTYPE_CRON);
} else {
// updateBlobTrigger(conn, trigger);
ps.setString(8, TTYPE_BLOB);
}
ps.setBigDecimal(9, new BigDecimal(String.valueOf(trigger
.getStartTime().getTime())));
long endTime = 0;
if (trigger.getEndTime() != null) {
endTime = trigger.getEndTime().getTime();
}
ps.setBigDecimal(10, new BigDecimal(String.valueOf(endTime)));
ps.setString(11, trigger.getCalendarName());
ps.setInt(12, trigger.getMisfireInstruction());
ps.setInt(13, trigger.getPriority());
ps.setBinaryStream(14, bais, len);
ps.setString(15, trigger.getName());
ps.setString(16, trigger.getGroup());
insertResult = ps.executeUpdate();
} finally {
closeStatement(ps);
}
if (insertResult > 0) {
deleteTriggerListeners(conn, trigger.getName(), trigger.getGroup());
String[] trigListeners = trigger.getTriggerListenerNames();
for (int i = 0; trigListeners != null && i < trigListeners.length; i++) {
insertTriggerListener(conn, trigger, trigListeners[i]);
}
}
return insertResult;
}
示例5: insertTrigger
import org.quartz.Trigger; //導入方法依賴的package包/類
/**
* <p>
* Insert the base trigger data.
* </p>
*
* @param conn
* the DB Connection
* @param trigger
* the trigger to insert
* @param state
* the state that the trigger should be stored in
* @return the number of rows inserted
*/
public int insertTrigger(Connection conn, Trigger trigger, String state,
JobDetail jobDetail) throws SQLException, IOException {
ByteArrayOutputStream baos = null;
if(trigger.getJobDataMap().size() > 0) {
baos = serializeJobData(trigger.getJobDataMap());
}
PreparedStatement ps = null;
int insertResult = 0;
try {
ps = conn.prepareStatement(rtp(INSERT_TRIGGER));
ps.setString(1, trigger.getName());
ps.setString(2, trigger.getGroup());
ps.setString(3, trigger.getJobName());
ps.setString(4, trigger.getJobGroup());
setBoolean(ps, 5, trigger.isVolatile());
ps.setString(6, trigger.getDescription());
if(trigger.getNextFireTime() != null)
ps.setBigDecimal(7, new BigDecimal(String.valueOf(trigger
.getNextFireTime().getTime())));
else
ps.setBigDecimal(7, null);
long prevFireTime = -1;
if (trigger.getPreviousFireTime() != null) {
prevFireTime = trigger.getPreviousFireTime().getTime();
}
ps.setBigDecimal(8, new BigDecimal(String.valueOf(prevFireTime)));
ps.setString(9, state);
if (trigger instanceof SimpleTrigger && ((SimpleTrigger)trigger).hasAdditionalProperties() == false ) {
ps.setString(10, TTYPE_SIMPLE);
} else if (trigger instanceof CronTrigger && ((CronTrigger)trigger).hasAdditionalProperties() == false ) {
ps.setString(10, TTYPE_CRON);
} else {
ps.setString(10, TTYPE_BLOB);
}
ps.setBigDecimal(11, new BigDecimal(String.valueOf(trigger
.getStartTime().getTime())));
long endTime = 0;
if (trigger.getEndTime() != null) {
endTime = trigger.getEndTime().getTime();
}
ps.setBigDecimal(12, new BigDecimal(String.valueOf(endTime)));
ps.setString(13, trigger.getCalendarName());
ps.setInt(14, trigger.getMisfireInstruction());
setBytes(ps, 15, baos);
ps.setInt(16, trigger.getPriority());
insertResult = ps.executeUpdate();
} finally {
closeStatement(ps);
}
if (insertResult > 0) {
String[] trigListeners = trigger.getTriggerListenerNames();
for (int i = 0; trigListeners != null && i < trigListeners.length; i++) {
insertTriggerListener(conn, trigger, trigListeners[i]);
}
}
return insertResult;
}