Add operation request column in dynamic task

operation-request
Gimhan Wijayawardana 9 months ago
parent c8cf4b86ca
commit 16cf3e4775

@ -27,6 +27,7 @@ public class DynamicTask {
private boolean isEnabled; private boolean isEnabled;
private int tenantId; private int tenantId;
private String taskClassName; private String taskClassName;
private String operationRequest;
private Map<String, String> properties; private Map<String, String> properties;
public int getDynamicTaskId() { public int getDynamicTaskId() {
@ -77,6 +78,14 @@ public class DynamicTask {
this.taskClassName = taskClassName; this.taskClassName = taskClassName;
} }
public String getOperationRequest() {
return operationRequest;
}
public void setOperationRequest(String operationRequest) {
this.operationRequest = operationRequest;
}
public Map<String, String> getProperties() { public Map<String, String> getProperties() {
return properties; return properties;
} }

@ -40,15 +40,16 @@ public class DynamicTaskDAOImpl implements DynamicTaskDAO {
int taskId = -1; int taskId = -1;
try { try {
Connection conn = TaskManagementDAOFactory.getConnection(); Connection conn = TaskManagementDAOFactory.getConnection();
String sql = "INSERT INTO DYNAMIC_TASK(CRON, NAME, IS_ENABLED, TASK_CLASS_NAME, TENANT_ID) " + String sql = "INSERT INTO DYNAMIC_TASK(CRON, NAME, IS_ENABLED, TASK_CLASS_NAME, OPERATION_REQUEST, TENANT_ID) " +
"VALUES (?, ?, ?, ?, ?)"; "VALUES (?, ?, ?, ?, ?, ?)";
stmt = conn.prepareStatement(sql, new String[]{"DYNAMIC_TASK_ID"}); stmt = conn.prepareStatement(sql, new String[]{"DYNAMIC_TASK_ID"});
stmt.setString(1, dynamicTask.getCronExpression()); stmt.setString(1, dynamicTask.getCronExpression());
stmt.setString(2, dynamicTask.getName()); stmt.setString(2, dynamicTask.getName());
stmt.setBoolean(3, dynamicTask.isEnabled()); stmt.setBoolean(3, dynamicTask.isEnabled());
stmt.setString(4, dynamicTask.getTaskClassName()); stmt.setString(4, dynamicTask.getTaskClassName());
stmt.setInt(5, PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId()); stmt.setString(5, dynamicTask.getOperationRequest());
stmt.setInt(6, PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
stmt.executeUpdate(); stmt.executeUpdate();
rs = stmt.getGeneratedKeys(); rs = stmt.getGeneratedKeys();

@ -93,6 +93,7 @@ public class TaskManagementDAOUtil {
dynamicTask.setDynamicTaskId(rs.getInt("DYNAMIC_TASK_ID")); dynamicTask.setDynamicTaskId(rs.getInt("DYNAMIC_TASK_ID"));
dynamicTask.setName(rs.getString("NAME")); dynamicTask.setName(rs.getString("NAME"));
dynamicTask.setCronExpression(rs.getString("CRON")); dynamicTask.setCronExpression(rs.getString("CRON"));
dynamicTask.setOperationRequest(rs.getString("OPERATION_REQUEST"));
dynamicTask.setTaskClassName(rs.getString("TASK_CLASS_NAME")); dynamicTask.setTaskClassName(rs.getString("TASK_CLASS_NAME"));
dynamicTask.setEnabled(rs.getBoolean("IS_ENABLED")); dynamicTask.setEnabled(rs.getBoolean("IS_ENABLED"));
dynamicTask.setTenantId(rs.getInt("TENANT_ID")); dynamicTask.setTenantId(rs.getInt("TENANT_ID"));

Loading…
Cancel
Save