Browse Source

Merge branch 'master' of http://192.168.1.220:10080/esb/esb

demon 8 years ago
parent
commit
92c322442b

+ 1 - 6
hos-arbiter/src/main/java/com/yihu/hos/arbiter/HosArbiterApplication.java

@ -1,6 +1,5 @@
package com.yihu.hos.arbiter;
import com.yihu.hos.arbiter.listener.ApplicationStartListener;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@ -11,11 +10,7 @@ import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfigurat
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
public class HosArbiterApplication implements CommandLineRunner {
    public static void main(String[] args) {
//        SpringApplication.run(HosArbiterApplication.class, args);
        SpringApplication app = new SpringApplication(HosArbiterApplication.class);
        app.addListeners(new ApplicationStartListener());
        app.run(args);
        SpringApplication.run(HosArbiterApplication.class, args);
    }
    @Override

+ 2 - 0
hos-arbiter/src/main/java/com/yihu/hos/arbiter/listener/ApplicationStartListener.java

@ -6,7 +6,9 @@ import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
@Component
public class ApplicationStartListener implements ApplicationListener<ContextRefreshedEvent> {
    private static Logger logger = LogManager.getLogger(ApplicationStartListener.class);

+ 26 - 8
hos-arbiter/src/main/java/com/yihu/hos/arbiter/models/BrokerServer.java

@ -21,14 +21,14 @@ public class BrokerServer {
    private boolean registered;
    @Indexed(name = "updateTime_1", expireAfterSeconds = 30)
    private Date updateTime;
    private ArrayList<Flow> onFlowList;
    private ArrayList<ServiceFlow> serviceFlows;
    public boolean isFlowOn(String routeCode) {
        if (onFlowList == null) {
        if (serviceFlows == null) {
            return false;
        }
        for (Flow flow : onFlowList) {
        for (ServiceFlow flow : serviceFlows) {
            if (flow.getRouteCode().equals(routeCode)) {
                return true;
            }
@ -89,12 +89,20 @@ public class BrokerServer {
        this.enable = enable;
    }
    public ArrayList<Flow> getOnFlowList() {
        return onFlowList;
    public ArrayList<ServiceFlow> getServiceFlows() {
        return serviceFlows;
    }
    public void setOnFlowList(ArrayList<Flow> onFlowList) {
        this.onFlowList = onFlowList;
    public void setServiceFlows(ArrayList<ServiceFlow> serviceFlows) {
        this.serviceFlows = serviceFlows;
    }
    public void addServiceFlow(ServiceFlow serviceFlow){
        if (serviceFlows == null){
            serviceFlows = new ArrayList<>();
        }
        serviceFlows.add(serviceFlow);
    }
    public boolean isRegistered() {
@ -105,7 +113,9 @@ public class BrokerServer {
        this.registered = registered;
    }
    public class Flow {
    static public class ServiceFlow {
        @Indexed
        String flowId;
        String routeCode;
        String type;
        Date updated;
@ -133,5 +143,13 @@ public class BrokerServer {
        public void setUpdated(Date updated) {
            this.updated = updated;
        }
        public String getFlowId() {
            return flowId;
        }
        public void setFlowId(String flowId) {
            this.flowId = flowId;
        }
    }
}

+ 4 - 1
hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/ArbiterServerService.java

@ -21,7 +21,7 @@ import org.springframework.stereotype.Service;
 */
@Service
public class ArbiterServerService {
    private static final Logger logger = LogManager.getLogger(BrokerServerService.class);
    private static final Logger logger = LogManager.getLogger(ArbiterServerService.class);
    @Autowired
    private MongoOperations mongoOperations;
@ -30,6 +30,9 @@ public class ArbiterServerService {
    @Autowired
    private ObjectMapper objectMapper;
    public ArbiterServerService() {
    }
    public void start() {
        //中心Arbiter服务器直接注册
        if (configuration.isCentral()) {

+ 46 - 29
hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/BrokerServerService.java

@ -7,6 +7,7 @@ import com.yihu.hos.arbiter.models.BrokerServer;
import com.yihu.hos.core.http.HTTPResponse;
import com.yihu.hos.core.http.HttpClientKit;
import com.yihu.hos.web.framework.constant.ServiceFlowConstant;
import com.yihu.hos.web.framework.model.bo.ServiceFlow;
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.log4j.LogManager;
@ -54,9 +55,8 @@ public class BrokerServerService {
        update.set("port", brokerServer.getPort());
        update.set("updateTime", brokerServer.getUpdateTime());
        update.set("enable", brokerServer.isEnable());
//        update.set("registered", true); //?
        if (brokerServer.getOnFlowList() != null) {
            update.set("onFlowList", brokerServer.getOnFlowList());
        for (BrokerServer.ServiceFlow serviceFlow : brokerServer.getServiceFlows()) {
            update.addToSet("serviceFlows", serviceFlow);
        }
        WriteResult writeResult = mongoOperations.upsert(query, update, BrokerServer.class);
@ -69,7 +69,7 @@ public class BrokerServerService {
            //确保Broker已经启动了流程
            brokerServer = mongoOperations.findOne(query, BrokerServer.class);
            if (brokerServer.getOnFlowList() != null) {
            if (brokerServer.getServiceFlows() != null) {
                return;
            }
        }
@ -87,29 +87,6 @@ public class BrokerServerService {
        }
    }
    public void updateFlowOn(BrokerServer brokerServer, BrokerServer.Flow flow) {
        Query query = new Query();
        query.addCriteria(Criteria.where("hostName").is(brokerServer.getHostName()));
        query.addCriteria(Criteria.where("hostAddress").is(brokerServer.getHostAddress()));
        query.addCriteria(Criteria.where("port").is(brokerServer.getPort()));
        BrokerServer broker = mongoOperations.findOne(query, BrokerServer.class);
        if (broker == null) {
            return;
        }
        ArrayList<BrokerServer.Flow> onFlowList = broker.getOnFlowList();
        if (onFlowList == null) {
            onFlowList = new ArrayList<>();
        }
        onFlowList.add(flow);
        Update update = new Update();
        update.set("onFlowList", onFlowList);
        mongoOperations.updateFirst(query, update, BrokerServer.class);
        //可以用ExecCommand的方法。
    }
    /**
     * 暂不提供动态均衡算法,只是随机返回一个。
     *
@ -140,9 +117,10 @@ public class BrokerServerService {
        return mongoOperations.find(query, BrokerServer.class);
    }
    public List<BrokerServer> getFlowOnBroker(String routeCode) {
    public List<BrokerServer> getBrokerList(String routeCode) {
        Query query = new Query();
        query.addCriteria(Criteria.where("onFlowList.routeCode").is(routeCode));
        query.addCriteria(Criteria.where("serviceFlows.routeCode").is(routeCode));
        return mongoOperations.find(query, BrokerServer.class);
    }
@ -150,6 +128,45 @@ public class BrokerServerService {
    }
    public void addServiceFlow(BrokerServer brokerServer, ServiceFlow serviceFlow) {
        BrokerServer.ServiceFlow flow = new BrokerServer.ServiceFlow();
        flow.setFlowId(serviceFlow.getId());
        flow.setRouteCode(serviceFlow.getRouteCode());
        flow.setType(serviceFlow.getFlowType());
        brokerServer.addServiceFlow(flow);
        Query query = new Query();
        query.addCriteria(Criteria.where("hostName").is(brokerServer.getHostName()));
        query.addCriteria(Criteria.where("hostAddress").is(brokerServer.getHostAddress()));
        query.addCriteria(Criteria.where("port").is(brokerServer.getPort()));
        Update update = new Update();
        update.set("hostName", brokerServer.getHostName());
        update.set("hostAddress", brokerServer.getHostAddress());
        update.set("port", brokerServer.getPort());
        update.set("updateTime", brokerServer.getUpdateTime());
        update.set("enable", brokerServer.isEnable());
        update.addToSet("serviceFlows", serviceFlow);
        mongoOperations.upsert(query, update, BrokerServer.class);
    }
    public void removeServiceFlow(BrokerServer brokerServer, ServiceFlow serviceFlow) {
        Query query = new Query();
        query.addCriteria(Criteria.where("hostName").is(brokerServer.getHostName()));
        query.addCriteria(Criteria.where("hostAddress").is(brokerServer.getHostAddress()));
        query.addCriteria(Criteria.where("port").is(brokerServer.getPort()));
        Update update = new Update();
        update.set("hostName", brokerServer.getHostName());
        update.set("hostAddress", brokerServer.getHostAddress());
        update.set("port", brokerServer.getPort());
        update.set("updateTime", brokerServer.getUpdateTime());
        update.set("enable", brokerServer.isEnable());
        update.pull("serviceFlows", serviceFlow);
        mongoOperations.upsert(query, update, BrokerServer.class);
    }
    private ProducerTemplate createProducerTemplate() {
        if (producerTemplate == null) {
            producerTemplate = camelContext.createProducerTemplate();

+ 274 - 72
hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/ServiceFlowService.java

@ -17,8 +17,6 @@ import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@ -45,36 +43,35 @@ public class ServiceFlowService {
    private ArbiterServerService arbiterServerService;
    public void save(ServiceFlow serviceFlow) {
    public ServiceFlow save(ServiceFlow serviceFlow) {
        if (serviceFlow == null) {
            logger.error("ServiceFlow is null");
            return;
            return null;
        }
        Query query = new Query();
        query.addCriteria(Criteria.where("routeCode").is(serviceFlow.getRouteCode()));
        ServiceFlow flow = mongoOperations.findOne(query, ServiceFlow.class);
        Update update = new Update();
        update.set("routeCode", serviceFlow.getRouteCode());
        update.set("updated", serviceFlow.getUpdated());
        update.set("flowType", serviceFlow.getFlowType());
        if (flow != null) {
            HashSet<ServiceFlow.HandleFile> flowSets = new HashSet<>(flow.getHandleFiles());
            HashSet<ServiceFlow.HandleFile> serviceFlowSets = new HashSet<>(serviceFlow.getHandleFiles());
            flowSets.addAll(serviceFlowSets);
            ArrayList<ServiceFlow.HandleFile> handleFiles = new ArrayList<>(flowSets);
            update.set("handleFiles", handleFiles); //没有用原生语法比较复杂
        } else {
            update.set("handleFiles", serviceFlow.getHandleFiles());
        for (ServiceFlow.HandleFile handleFile : serviceFlow.getHandleFiles()) {
            update.addToSet("handleFiles", handleFile);
        }
        mongoOperations.upsert(query, update, ServiceFlow.class);
        return mongoOperations.findOne(query, ServiceFlow.class);
    }
    public String get(String serviceName) {
        return null;
    }
    public void delete(ServiceFlow serviceFlow) {
        mongoOperations.remove(serviceFlow);
    }
    public List<ServiceFlow> getAll() {
        return mongoOperations.findAll(ServiceFlow.class);
    }
@ -85,58 +82,259 @@ public class ServiceFlowService {
     * @param msg serviceFlow
     */
    public void serviceFlowStarted(String msg) {
        flowController("post", "/esb/serviceFlow/start", msg);
    }
        try {
            ServiceFlow serviceFlow = getServiceFlow(msg);
            serviceFlow = this.save(serviceFlow);
    /**
     * 没有使用重载,是因为Camel在判断路由时会产生歧义,而无法路由。
     *
     * @param msg          serviceFlow
     * @param brokerServer brokerServer Info
     */
    public void serviceFlowStart(String msg, BrokerServer brokerServer) {
        flowController("post", "/esb/serviceFlow/start", msg, brokerServer);
            boolean one = ServiceFlowConstant.JAVA.equals(serviceFlow.getFlowType());//java类型为采集任务
            if (one && isStarted(serviceFlow)) {
                return;
            }
            List<BrokerServer> brokerServerList;
            brokerServerList = brokerServerService.get(one);
            for (BrokerServer broker : brokerServerList) {
                boolean result = sendMessage(broker, "post", "/esb/serviceFlow/start", msg);
                if (!result) {
                    logger.error("sendMessage to broker server failed, broker:" + broker.getURL() + ", msg:" + msg);
                    continue;
                }
                brokerServerService.addServiceFlow(broker, serviceFlow);
            }
        } catch (IOException e) {
            e.printStackTrace();
            logger.error(e.getMessage());
        }
    }
    public void serviceFlowStopped(String msg) {
        flowController("post", "/esb/serviceFlow/stop", msg);
        try {
            ServiceFlow serviceFlow = getServiceFlow(msg);
            this.delete(serviceFlow);
            List<BrokerServer> brokerServerList;
            brokerServerList = brokerServerService.get(false);
            for (BrokerServer broker : brokerServerList) {
                HTTPResponse response = HttpClientKit.post(broker.getURL() + "", msg);
                if (response.getStatusCode() == 200) {
                    String body = response.getBody();
                    logger.debug(body);
                }
                boolean result = sendMessage(broker, "post", "/esb/serviceFlow/stop", msg);
                if (!result) {
                    logger.error("sendMessage to broker server failed, broker:" + broker.getURL() + ", msg:" + msg);
                    continue;
                }
                brokerServerService.removeServiceFlow(broker, serviceFlow);
            }
        } catch (IOException e) {
            e.printStackTrace();
            logger.error(e.getMessage());
        }
    }
    public void serviceFlowAdd(String msg) {
        flowController("post", "/esb/serviceFlow", msg);
        try {
            ServiceFlow serviceFlow = getServiceFlow(msg);
            serviceFlow = this.save(serviceFlow);
            boolean one = ServiceFlowConstant.JAVA.equals(serviceFlow.getFlowType());//java类型为采集任务
            if (one) {
                BrokerServer brokerServer = brokerServerService.get();
                boolean result = sendMessage(brokerServer, "post", "/esb/serviceFlow", msg);
                if (!result) {
                    logger.error("sendMessage to broker server failed, broker:" + brokerServer.getURL() + ", msg:" + msg);
                    return;
                }
                brokerServerService.addServiceFlow(brokerServer, serviceFlow);
                return;
            }
            List<BrokerServer> brokerServerList;
            brokerServerList = brokerServerService.get(one);
            for (BrokerServer broker : brokerServerList) {
                boolean result = sendMessage(broker, "post", "/esb/serviceFlow", msg);
                if (!result) {
                    logger.error("sendMessage to broker server failed, broker:" + broker.getURL() + ", msg:" + msg);
                    continue;
                }
                brokerServerService.addServiceFlow(broker, serviceFlow);
            }
        } catch (IOException e) {
            e.printStackTrace();
            logger.error(e.getMessage());
        }
    }
    public void serviceFlowModifyAdd(String msg) {
        flowController("put", "/esb/serviceFlow/add", msg);
        try {
            ServiceFlow serviceFlow = getServiceFlow(msg);
            serviceFlow = this.save(serviceFlow);
            boolean one = ServiceFlowConstant.JAVA.equals(serviceFlow.getFlowType());//java类型为采集任务
            if (one) {
                List<BrokerServer> brokerList = brokerServerService.getBrokerList(serviceFlow.getRouteCode());
                if (brokerList == null || brokerList.size() == 0) {
                    logger.error("service flow stopped unexpected.");
                    return;
                }
                boolean result = sendMessage(brokerList.get(0), "put", "/esb/serviceFlow/add", msg);
                if (!result) {
                    logger.error("sendMessage to broker server failed, broker:" + brokerList.get(0).getURL() + ", msg:" + msg);
                    return;
                }
                brokerServerService.addServiceFlow(brokerList.get(0), serviceFlow);
                return;
            }
            List<BrokerServer> brokerServerList;
            brokerServerList = brokerServerService.get(one);
            for (BrokerServer broker : brokerServerList) {
                boolean result = sendMessage(broker, "put", "/esb/serviceFlow/add", msg);
                if (!result) {
                    logger.error("sendMessage to broker server failed, broker:" + broker.getURL() + ", msg:" + msg);
                    continue;
                }
                brokerServerService.addServiceFlow(broker, serviceFlow);
            }
        } catch (IOException e) {
            e.printStackTrace();
            logger.error(e.getMessage());
        }
    }
    public void serviceFlowModifyReduce(String msg) {
        flowController("put", "/esb/serviceFlow/reduce", msg);
        try {
            ServiceFlow serviceFlow = getServiceFlow(msg);
            serviceFlow = this.save(serviceFlow);
            boolean one = ServiceFlowConstant.JAVA.equals(serviceFlow.getFlowType());//java类型为采集任务
            if (one) {
                List<BrokerServer> brokerList = brokerServerService.getBrokerList(serviceFlow.getRouteCode());
                if (brokerList == null || brokerList.size() == 0) {
                    logger.error("service flow stopped unexpected.");
                    return;
                }
                boolean result = sendMessage(brokerList.get(0), "put", "/esb/serviceFlow/reduce", msg);
                if (!result) {
                    logger.error("sendMessage to broker server failed, broker:" + brokerList.get(0).getURL() + ", msg:" + msg);
                    return;
                }
                brokerServerService.addServiceFlow(brokerList.get(0), serviceFlow);
                return;
            }
            List<BrokerServer> brokerServerList;
            brokerServerList = brokerServerService.get(one);
            for (BrokerServer broker : brokerServerList) {
                boolean result = sendMessage(broker, "put", "/esb/serviceFlow/reduce", msg);
                if (!result) {
                    logger.error("sendMessage to broker server failed, broker:" + broker.getURL() + ", msg:" + msg);
                    continue;
                }
                brokerServerService.addServiceFlow(broker, serviceFlow);
            }
        } catch (IOException e) {
            e.printStackTrace();
            logger.error(e.getMessage());
        }
    }
    public void serviceFlowDelete(String msg) {
        flowController("delete", "/esb/serviceFlow", msg);
        try {
            ServiceFlow serviceFlow = getServiceFlow(msg);
            serviceFlow = this.save(serviceFlow);
            boolean one = ServiceFlowConstant.JAVA.equals(serviceFlow.getFlowType());//java类型为采集任务
            if (one) {
                List<BrokerServer> brokerList = brokerServerService.getBrokerList(serviceFlow.getRouteCode());
                if (brokerList == null || brokerList.size() == 0) {
                    logger.error("service flow stopped unexpected.");
                    return;
                }
                boolean result = sendMessage(brokerList.get(0), "delete", "/esb/serviceFlow", msg);
                if (!result) {
                    logger.error("sendMessage to broker server failed, broker:" + brokerList.get(0).getURL() + ", msg:" + msg);
                    return;
                }
                brokerServerService.removeServiceFlow(brokerList.get(0), serviceFlow);
                return;
            }
            List<BrokerServer> brokerServerList;
            brokerServerList = brokerServerService.get(one);
            for (BrokerServer broker : brokerServerList) {
                boolean result = sendMessage(broker, "delete", "/esb/serviceFlow", msg);
                if (!result) {
                    logger.error("sendMessage to broker server failed, broker:" + broker.getURL() + ", msg:" + msg);
                    continue;
                }
                brokerServerService.removeServiceFlow(broker, serviceFlow);
            }
        } catch (IOException e) {
            e.printStackTrace();
            logger.error(e.getMessage());
        }
    }
    public void brokerServerOn(String msg) {
        List<ServiceFlow> serviceFlowList = getAll();
        serviceFlowList.forEach(serviceFlow -> {
            try {
                serviceFlow = this.save(serviceFlow);
                boolean one = ServiceFlowConstant.JAVA.equals(serviceFlow.getFlowType());//java类型为采集任务
                if (one && isStarted(serviceFlow)) {
                    return;
                }
                BrokerServer brokerServer = objectMapper.readValue(msg, BrokerServer.class);
                String serviceFlowMsg = objectMapper.writeValueAsString(serviceFlow);
                serviceFlowStart(serviceFlowMsg, brokerServer);
                boolean result = sendMessage(brokerServer, "post", "/esb/serviceFlow/start", serviceFlowMsg);
                if (!result) {
                    logger.error("sendMessage to broker server failed, broker:" + brokerServer.getURL() + ", msg:" + serviceFlowMsg);
                    return;
                }
                brokerServerService.addServiceFlow(brokerServer, serviceFlow);
            } catch (IOException e) {
                e.printStackTrace();
                logger.error(e.getMessage());
            }
        });
    }
    public void brokerServerOff(String msg) {
        //下先Broker就可以了
        //可以不用处理。
    }
    /**
     * SAAS化的管理端过来的消息会被proxy进行中转,之后发送到终端的Arbiter对Broker进行实际的控制。
     *
@ -150,61 +348,65 @@ public class ServiceFlowService {
        HttpClientKit.post(arbiterServer.getUrl(), msg, header);
    }
    private void flowController(String method, String path, String msg) {
        this.flowController(method, path, msg, null);
    }
    private boolean sendMessage(BrokerServer brokerServer, String method, String path, String msg) {
        if (brokerServer == null) {
            return false;
        }
        switch (method) {
            case "post": {
                HTTPResponse response = HttpClientKit.post(brokerServer.getURL() + path, msg);
                if (response.getStatusCode() == 200) {
                    String body = response.getBody();
                    logger.debug(body);
                    return true;
                }
    private void flowController(String method, String path, String msg, BrokerServer brokerServer) {
        try {
            ServiceFlow serviceFlow = getServiceFlow(msg);
//            this.save(serviceFlow); //需要改造??
                return false;
            }
            boolean one = ServiceFlowConstant.JAVA.equals(serviceFlow.getFlowType());   //有cron表达式,就是采集任务。
            if (one) {
                List<BrokerServer> flowOnBroker = brokerServerService.getFlowOnBroker(serviceFlow.getRouteCode());
                if (flowOnBroker != null && flowOnBroker.size() != 0) {
                    return;
            case "put": {
                HTTPResponse response = HttpClientKit.put(brokerServer.getURL() + path, msg);
                if (response.getStatusCode() == 200) {
                    String body = response.getBody();
                    logger.debug(body);
                    return true;
                }
            }
            List<BrokerServer> brokerServerList = new ArrayList<>();
            if (brokerServer != null) {
                brokerServerList.add(brokerServer);
            } else {
                brokerServerList = brokerServerService.get(one);
                return false;
            }
            for (BrokerServer broker : brokerServerList) {
//                if (broker.isFlowOn(serviceFlow.getRouteCode())) {
//                    continue;
//                }
                switch (method) {
                    case "post":
                        HTTPResponse response = HttpClientKit.post(broker.getURL() + path, msg);
                        if (response.getStatusCode() == 200) {
                            String body = response.getBody();
                        }
                        break;
                    case "put":
                        HttpClientKit.put(broker.getURL() + path, msg);
                        break;
                    case "delete":
                        HttpClientKit.delete(broker.getURL() + path, msg);
                        break;
                    default:
                        break;
            case "delete": {
                HTTPResponse response = HttpClientKit.delete(brokerServer.getURL() + path, msg);
                if (response.getStatusCode() == 200) {
                    String body = response.getBody();
                    logger.debug(body);
                    return true;
                }
                return false;
            }
        } catch (IOException e) {
            e.printStackTrace();
            logger.error(e.getMessage());
            default:
                break;
        }
        return false;
    }
    private ServiceFlow getServiceFlow(String msg) throws IOException {
        return objectMapper.readValue(msg, ServiceFlow.class);
    }
    private boolean isStarted(ServiceFlow serviceFlow) {
        List<BrokerServer> brokerList = brokerServerService.getBrokerList(serviceFlow.getRouteCode());
        if (brokerList != null && brokerList.size() != 0) {
            logger.debug("service flow is already started on the broker");
            return true;
        }
        return false;
    }
}

+ 10 - 0
hos-web-framework/src/main/java/com/yihu/hos/web/framework/model/bo/ServiceFlow.java

@ -1,5 +1,6 @@
package com.yihu.hos.web.framework.model.bo;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.ArrayList;
@ -11,11 +12,20 @@ import java.util.Date;
 */
@Document
public class ServiceFlow {
    @Id
    private String id;
    private String routeCode;
    private ArrayList<HandleFile> handleFiles;
    private Date updated;
    private String flowType;    //pull or push?
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getRouteCode() {
        return routeCode;