Examples of BackupScheduleConfig


Examples of org.apdplat.module.system.model.BackupScheduleConfig

     */
    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        if (event instanceof ContextRefreshedEvent) {
            LOG.info("spring容器初始化完成, 开始检查是否需要启动定时备份数据调度器");
            BackupScheduleConfig config = getBackupScheduleConfig();
            if (config != null && config.isEnabled()) {
                schedule(config.getScheduleHour(),config.getScheduleMinute());
                LOG.info("启动定时备份数据调度器");
            }else{
                LOG.info("没有设置定时备份数据任务");
            }
        }
View Full Code Here

Examples of org.apdplat.module.system.model.BackupScheduleConfig

     * @return 备份数据库调度配置
     */
    public BackupScheduleConfig getBackupScheduleConfig(){       
        Page<BackupScheduleConfig> page=serviceFacade.query(BackupScheduleConfig.class);
        if(page.getTotalRecords()==1){
            BackupScheduleConfig scheduleConfig=page.getModels().get(0)
            return scheduleConfig;
        }
        return null;
    }
View Full Code Here

Examples of org.apdplat.module.system.model.BackupScheduleConfig

     * 取消定时备份任务
     * @return  提示信息
     */
    public String unSchedule(){       
        try {
            BackupScheduleConfig config=getBackupScheduleConfig();
            if(config!=null){
                config.setEnabled(false);
                serviceFacade.update(config);
                LOG.info("禁用定时重建配置对象");
            }else{
                String tip="还没有设置定时备份数据任务";
                LOG.info(tip);
View Full Code Here

Examples of org.apdplat.module.system.model.BackupScheduleConfig

     * @param hour 几点
     * @param minute 几分
     * @return
     */
    public String schedule(int hour, int minute) {
        BackupScheduleConfig scheduleConfig = getBackupScheduleConfig();
        if (scheduleConfig == null) {
            //新建配置对象
            BackupScheduleConfig config = new BackupScheduleConfig();
            config.setScheduleHour(hour);
            config.setScheduleMinute(minute);
            config.setEnabled(true);
            serviceFacade.create(config);
        } else {
            //修改配置对象
            scheduleConfig.setScheduleHour(hour);
            scheduleConfig.setScheduleMinute(minute);
View Full Code Here

Examples of org.apdplat.module.system.model.BackupScheduleConfig

    private int minute;
   
   
    public String query(){
        Map map=new HashMap();
        BackupScheduleConfig config=null;
        try{
                config=backupSchedulerService.getBackupScheduleConfig();
        }catch(Exception e){
                LOG.warn("未获取到备份配置对象",e);
        }
       
        if(config!=null && config.isEnabled()){
            map.put("state", "定时备份数据任务执行频率为每天,时间(24小时制)"+config.getScheduleHour()+":"+config.getScheduleMinute());
            map.put("hour",config.getScheduleHour());
            map.put("minute", config.getScheduleMinute());

        }else{
            map.put("state", "无定时调度任务");
        }
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.