1 package com.kodexa.client.pipeline;
2
3 import com.kodexa.client.Document;
4 import com.kodexa.client.store.DataStore;
5 import lombok.Getter;
6 import lombok.Setter;
7
8 import java.util.*;
9 import java.util.stream.Collectors;
10
11
12
13
14
15 public class PipelineContext {
16
17
18
19
20 public Map<String, DataStore> stores = new HashMap<String, DataStore>();
21
22
23
24
25 private Document document;
26
27
28
29
30 @Getter
31 @Setter
32 private List<PipelineParameter> parameters = new ArrayList<>();
33
34
35
36
37
38
39
40 public DataStore getStore(String name) {
41 return stores.get(name);
42 }
43
44
45
46
47
48
49 public Set<String> getStoreNames() {
50 return stores.keySet();
51 }
52
53
54
55
56
57
58
59 public void addStore(String name, DataStore store) {
60 stores.put(name, store);
61 }
62
63
64
65
66
67
68 public void setOutputDocument(Document document) {
69 this.document = document;
70 }
71
72
73
74
75
76
77 public Document getOutputDocument() {
78 return this.document;
79 }
80
81 public Map<String, Object> getParameterMap() {
82 return this.parameters.stream()
83 .collect(Collectors.toMap(PipelineParameter::getName, PipelineParameter::getValue));
84 }
85 }