Java tutorial
/* * Copyright (C) 2017 Baifendian Corporation * * 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * 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. */ package com.baifendian.swordfish.dao.model; import com.baifendian.swordfish.dao.enums.ExecType; import com.baifendian.swordfish.dao.enums.FailurePolicyType; import com.baifendian.swordfish.dao.enums.FlowStatus; import com.baifendian.swordfish.dao.enums.NotifyType; import com.baifendian.swordfish.dao.model.flow.Property; import com.baifendian.swordfish.dao.utils.json.JsonUtil; import java.util.Date; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import org.apache.commons.lang.StringUtils; public class ExecutionFlow { /** * id ? **/ private Integer id; /** * workflow id ? flow_id **/ private int flowId; /** * worker host **/ private String worker; /** * workflow ? **/ private FlowStatus status; /** * ??id ? submit_user **/ private int submitUserId; /** * ???? **/ private String submitUser; /** * ? **/ private String proxyUser; /** * ?? **/ private Date submitTime; /** * **/ private Date startTime; /** * ? **/ private Date endTime; /** * workflow ? **/ private String workflowData; /** * workflow ????? **/ private String workflowDataSub; /** * workflow ? **/ private ExecType type; /** * */ private FailurePolicyType failurePolicy; /** * workflow id */ private Integer projectId; /** * workflow ?? */ private String projectName; /** * ??? DTO? */ private String workflowName; /** * **/ private Date scheduleTime; /** * ? */ private Integer maxTryTimes; /** * */ private Integer timeout; /** * ?? */ private String userDefinedParams; /** * ??? */ private String extras; /** * ? */ private Map<String, String> userDefinedParamMap; /** * ? notify_type */ private NotifyType notifyType; /** * */ private String notifyMails; /** * ? */ private List<String> notifyMailList; /** * ??? */ private String owner; /** * ?? **/ private String queue; public String getWorkflowName() { return workflowName; } public void setWorkflowName(String workflowName) { this.workflowName = workflowName; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public int getFlowId() { return flowId; } public void setFlowId(int flowId) { this.flowId = flowId; } public String getWorker() { return worker; } public void setWorker(String worker) { this.worker = worker; } public FlowStatus getStatus() { return status; } public void setStatus(FlowStatus status) { this.status = status; } public int getSubmitUserId() { return submitUserId; } public void setSubmitUserId(int submitUserId) { this.submitUserId = submitUserId; } public String getSubmitUser() { return submitUser; } public void setSubmitUser(String submitUser) { this.submitUser = submitUser; } public Date getSubmitTime() { return submitTime; } public void setSubmitTime(Date submitTime) { this.submitTime = submitTime; } public Date getStartTime() { return startTime; } public void setStartTime(Date startTime) { this.startTime = startTime; } public Date getEndTime() { return endTime; } public void setEndTime(Date endTime) { this.endTime = endTime; } public void setScheduleTime(Date scheduleTime) { this.scheduleTime = scheduleTime; } public String getWorkflowData() { return workflowData; } public void setWorkflowData(String workflowData) { this.workflowData = workflowData; } public String getWorkflowDataSub() { return workflowDataSub; } public void setWorkflowDataSub(String workflowDataSub) { this.workflowDataSub = workflowDataSub; } public ExecType getType() { return type; } public void setType(ExecType type) { this.type = type; } public FailurePolicyType getFailurePolicy() { return failurePolicy; } public void setFailurePolicy(FailurePolicyType failurePolicy) { this.failurePolicy = failurePolicy; } public Integer getProjectId() { return projectId; } public void setProjectId(Integer projectId) { this.projectId = projectId; } public String getProjectName() { return projectName; } public String getProxyUser() { return proxyUser; } public void setProxyUser(String proxyUser) { this.proxyUser = proxyUser; } public void setProjectName(String projectName) { this.projectName = projectName; } public String getQueue() { return queue; } public void setQueue(String queue) { this.queue = queue; } public Date getScheduleTime() { return scheduleTime; } public Integer getMaxTryTimes() { return maxTryTimes; } public void setMaxTryTimes(Integer maxTryTimes) { this.maxTryTimes = maxTryTimes; } public Integer getTimeout() { return timeout; } public void setTimeout(Integer timeout) { this.timeout = timeout; } public String getUserDefinedParams() { return userDefinedParams; } public void setUserDefinedParams(String userDefinedParams) { this.userDefinedParams = userDefinedParams; } public NotifyType getNotifyType() { return notifyType; } public void setNotifyType(NotifyType notifyType) { this.notifyType = notifyType; } public String getNotifyMails() { return notifyMails; } public void setNotifyMails(String notifyMails) { this.notifyMails = notifyMails; this.notifyMailList = JsonUtil.parseObjectList(notifyMails, String.class); } public List<String> getNotifyMailList() { return notifyMailList; } public void setNotifyMailList(List<String> notifyMailList) { this.notifyMailList = notifyMailList; this.notifyMails = JsonUtil.toJsonString(notifyMailList); } public String getOwner() { return owner; } public void setOwner(String owner) { this.owner = owner; } public String getExtras() { return extras; } public void setExtras(String extras) { this.extras = extras; } public void setUserDefinedParamMap(Map<String, String> userDefinedParamMap) { this.userDefinedParamMap = userDefinedParamMap; } public Map<String, String> getUserDefinedParamMap() { List<Property> propList; if (userDefinedParamMap == null && StringUtils.isNotEmpty(userDefinedParams)) { propList = JsonUtil.parseObjectList(userDefinedParams, Property.class); if (propList != null) { userDefinedParamMap = propList.stream() .collect(Collectors.toMap(Property::getProp, Property::getValue)); } } return userDefinedParamMap; } }