package com.vci.dbsync.entity;
|
/**
|
* Copyright 2018-2118 the original author or authors.
|
* <p>
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
* you may not use this file except in compliance with the License.
|
* You may obtain a copy of the License at
|
* <p>
|
* http://www.apache.org/licenses/LICENSE-2.0
|
* <p>
|
* Unless required by applicable law or agreed to in writing, software
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* See the License for the specific language governing permissions and
|
* limitations under the License.
|
*/
|
|
|
import java.io.Serializable;
|
import java.util.ArrayList;
|
import java.util.Iterator;
|
import java.util.List;
|
|
import org.dom4j.Element;
|
|
import com.vci.dbsync.utils.Tool;
|
|
/**
|
* @author liuyazhuang
|
* @date 2018/9/11 10:13
|
* @description 任务信息
|
* @version 1.0.0
|
*/
|
public class JobInfo implements Serializable {
|
private static final long serialVersionUID = -1907092113028096170L;
|
|
//任务名称
|
private String name;
|
//任务表达式
|
private String cron;
|
// //源数据源sql
|
// private String srcSql;
|
// //目标数据表
|
// private String destTable;
|
// //目标表数据字段
|
// private String destTableFields;
|
// //目标表主键
|
// private String destTableKey;
|
// //目标表可更新的字段
|
// private String destTableUpdate;
|
|
private List<JobItem> lstJobItem = new ArrayList<JobItem>();
|
|
public String getName() {
|
return name;
|
}
|
|
public void setName(String name) {
|
this.name = name;
|
}
|
|
public String getCron() {
|
return cron;
|
}
|
|
public void setCron(String cron) {
|
this.cron = cron;
|
}
|
|
public JobItem[] Items() {
|
return lstJobItem.toArray(new JobItem[0]);
|
}
|
|
public void initJobItems(Element ejob) {
|
try {
|
for (@SuppressWarnings("rawtypes")
|
Iterator it = ejob.elementIterator("item"); it.hasNext();) {
|
lstJobItem.add((JobItem) Tool.elementInObject((Element) it.next(), new JobItem()));
|
}
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
|
// public String getSrcSql() {
|
// return srcSql;
|
// }
|
//
|
// public void setSrcSql(String srcSql) {
|
// this.srcSql = srcSql;
|
// }
|
//
|
// public String getDestTable() {
|
// return destTable;
|
// }
|
//
|
// public void setDestTable(String destTable) {
|
// this.destTable = destTable;
|
// }
|
//
|
// public String getDestTableFields() {
|
// return destTableFields;
|
// }
|
//
|
// public void setDestTableFields(String destTableFields) {
|
// this.destTableFields = destTableFields;
|
// }
|
//
|
// public String getDestTableKey() {
|
// return destTableKey;
|
// }
|
//
|
// public void setDestTableKey(String destTableKey) {
|
// this.destTableKey = destTableKey;
|
// }
|
//
|
// public String getDestTableUpdate() {
|
// return destTableUpdate;
|
// }
|
//
|
// public void setDestTableUpdate(String destTableUpdate) {
|
// this.destTableUpdate = destTableUpdate;
|
// }
|
}
|