当前位置: 首页>>代码示例>>Java>>正文


Java OperableTrigger.getEndTime方法代码示例

本文整理汇总了Java中org.quartz.spi.OperableTrigger.getEndTime方法的典型用法代码示例。如果您正苦于以下问题:Java OperableTrigger.getEndTime方法的具体用法?Java OperableTrigger.getEndTime怎么用?Java OperableTrigger.getEndTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.quartz.spi.OperableTrigger的用法示例。


在下文中一共展示了OperableTrigger.getEndTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: insertTrigger

import org.quartz.spi.OperableTrigger; //导入方法依赖的package包/类
@Override
public int insertTrigger(Connection conn, OperableTrigger 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.getKey().getName());
        ps.setString(2, trigger.getKey().getGroup());
        ps.setString(3, trigger.getJobKey().getName());
        ps.setString(4, trigger.getJobKey().getGroup());
        ps.setString(5, trigger.getDescription());
        ps.setBigDecimal(6, new BigDecimal(String.valueOf(trigger
                .getNextFireTime().getTime())));
        long prevFireTime = -1;
        if (trigger.getPreviousFireTime() != null) {
            prevFireTime = trigger.getPreviousFireTime().getTime();
        }
        ps.setBigDecimal(7, new BigDecimal(String.valueOf(prevFireTime)));
        ps.setString(8, state);
        
        TriggerPersistenceDelegate tDel = findTriggerPersistenceDelegate(trigger);
        
        String type = TTYPE_BLOB;
        if(tDel != null)
            type = tDel.getHandledTriggerTypeDiscriminator();
        ps.setString(9, type);
        
        ps.setBigDecimal(10, new BigDecimal(String.valueOf(trigger
                .getStartTime().getTime())));
        long endTime = 0;
        if (trigger.getEndTime() != null) {
            endTime = trigger.getEndTime().getTime();
        }
        ps.setBigDecimal(11, new BigDecimal(String.valueOf(endTime)));
        ps.setString(12, trigger.getCalendarName());
        ps.setInt(13, trigger.getMisfireInstruction());
        ps.setBinaryStream(14, bais, len);
        ps.setInt(15, trigger.getPriority());
        
        insertResult = ps.executeUpdate();
        
        if(tDel == null)
            insertBlobTrigger(conn, trigger);
        else
            tDel.insertExtendedTriggerProperties(conn, trigger, state, jobDetail);
                    
    } finally {
        closeStatement(ps);
    }

    return insertResult;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:61,代码来源:PointbaseDelegate.java

示例2: updateTrigger

import org.quartz.spi.OperableTrigger; //导入方法依赖的package包/类
@Override           
public int updateTrigger(Connection conn, OperableTrigger 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.getJobKey().getName());
        ps.setString(2, trigger.getJobKey().getGroup());
        ps.setString(3, trigger.getDescription());
        long nextFireTime = -1;
        if (trigger.getNextFireTime() != null) {
            nextFireTime = trigger.getNextFireTime().getTime();
        }
        ps.setBigDecimal(4, new BigDecimal(String.valueOf(nextFireTime)));
        long prevFireTime = -1;
        if (trigger.getPreviousFireTime() != null) {
            prevFireTime = trigger.getPreviousFireTime().getTime();
        }
        ps.setBigDecimal(5, new BigDecimal(String.valueOf(prevFireTime)));
        ps.setString(6, state);
        
        TriggerPersistenceDelegate tDel = findTriggerPersistenceDelegate(trigger);
        
        String type = TTYPE_BLOB;
        if(tDel != null)
            type = tDel.getHandledTriggerTypeDiscriminator();

        ps.setString(7, type);
        
        ps.setBigDecimal(8, new BigDecimal(String.valueOf(trigger
                .getStartTime().getTime())));
        long endTime = 0;
        if (trigger.getEndTime() != null) {
            endTime = trigger.getEndTime().getTime();
        }
        ps.setBigDecimal(9, new BigDecimal(String.valueOf(endTime)));
        ps.setString(10, trigger.getCalendarName());
        ps.setInt(11, trigger.getMisfireInstruction());
        
        ps.setInt(12, trigger.getPriority());
        ps.setBinaryStream(13, bais, len);
        ps.setString(14, trigger.getKey().getName());
        ps.setString(15, trigger.getKey().getGroup());

        insertResult = ps.executeUpdate();
        
        if(tDel == null)
            updateBlobTrigger(conn, trigger);
        else
            tDel.updateExtendedTriggerProperties(conn, trigger, state, jobDetail);
        
    } finally {
        closeStatement(ps);
    }

    return insertResult;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:68,代码来源:PointbaseDelegate.java

示例3: insertTrigger

import org.quartz.spi.OperableTrigger; //导入方法依赖的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, OperableTrigger 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.getKey().getName());
        ps.setString(2, trigger.getKey().getGroup());
        ps.setString(3, trigger.getJobKey().getName());
        ps.setString(4, trigger.getJobKey().getGroup());
        ps.setString(5, trigger.getDescription());
        if(trigger.getNextFireTime() != null)
            ps.setBigDecimal(6, new BigDecimal(String.valueOf(trigger
                    .getNextFireTime().getTime())));
        else
            ps.setBigDecimal(6, null);
        long prevFireTime = -1;
        if (trigger.getPreviousFireTime() != null) {
            prevFireTime = trigger.getPreviousFireTime().getTime();
        }
        ps.setBigDecimal(7, new BigDecimal(String.valueOf(prevFireTime)));
        ps.setString(8, state);
        
        TriggerPersistenceDelegate tDel = findTriggerPersistenceDelegate(trigger);
        
        String type = TTYPE_BLOB;
        if(tDel != null)
            type = tDel.getHandledTriggerTypeDiscriminator();
        ps.setString(9, type);
        
        ps.setBigDecimal(10, new BigDecimal(String.valueOf(trigger
                .getStartTime().getTime())));
        long endTime = 0;
        if (trigger.getEndTime() != null) {
            endTime = trigger.getEndTime().getTime();
        }
        ps.setBigDecimal(11, new BigDecimal(String.valueOf(endTime)));
        ps.setString(12, trigger.getCalendarName());
        ps.setInt(13, trigger.getMisfireInstruction());
        setBytes(ps, 14, baos);
        ps.setInt(15, trigger.getPriority());
        
        insertResult = ps.executeUpdate();
        
        if(tDel == null)
            insertBlobTrigger(conn, trigger);
        else
            tDel.insertExtendedTriggerProperties(conn, trigger, state, jobDetail);
        
    } finally {
        closeStatement(ps);
    }

    return insertResult;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:77,代码来源:StdJDBCDelegate.java


注:本文中的org.quartz.spi.OperableTrigger.getEndTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。