wuxw
2019-02-07 c5aac73ec29f74904b544a722037b39bbb85ab3e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package com.java110.core.context;
 
import com.alibaba.fastjson.JSONObject;
import com.java110.entity.center.Business;
import com.java110.entity.center.DataFlowLinksCost;
import com.java110.entity.center.DataFlowLog;
import org.springframework.http.ResponseEntity;
 
import java.util.List;
import java.util.Map;
 
/**
 * 数据流上下文
 * Created by wuxw on 2018/5/18.
 */
public interface DataFlowContext {
 
    /**
     * 请求报文
     * @return
     */
    public String getReqData();
 
    //AppId
    public String getAppId();
 
    public JSONObject getReqJson();
    /**
     * 返回报文
     * @return
     */
    public JSONObject getResJson();
 
 
    /**
     * 添加各个环节的耗时
     * @param dataFlowLinksCost
     */
    public void addLinksCostDates(DataFlowLinksCost dataFlowLinksCost);
 
    /**
     * 添加日志信息
     * @param dataFlowLog
     */
    public void addLogDatas(DataFlowLog dataFlowLog);
 
    public List<DataFlowLinksCost> getLinksCostDates();
 
    public List<Business> getBusinesses();
 
    /**
     * 源请求头信息
     * @return
     */
    public Map<String, String> getRequestHeaders();
    /**
     * 终返回头信息
     * @return
     */
    public Map<String, String> getResponseHeaders();
 
    /**
     * 当前请求头信息
     * @return
     */
    public Map<String, String> getRequestCurrentHeaders();
 
    /**
     * 当前返回头信息
     * @return
     */
    public Map<String, String> getResponseCurrentHeaders();
 
 
    public IOrders getOrder();
 
 
    /**
     * 获取当前Business
     * @return
     */
    public Business getCurrentBusiness();
 
    public void setResJson(JSONObject resJson);
 
    /**
     * 获取参数
     * @return
     */
    public Map<String, Object> getParamOut();
 
    /**
     * 添加参数
     * @param key
     * @param value
     */
    public void addParamOut(String key,Object value);
 
 
    public String getbId();
 
    //业务编码,如果是批量受理就取第一个
    public String getServiceCode();
 
    public void setResponseEntity(ResponseEntity responseEntity);
 
    public ResponseEntity getResponseEntity();
}