1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.gwe.persistence.model.order;
18
19 import java.util.ArrayList;
20 import java.util.List;
21
22 import org.gwe.persistence.model.DaemonConfigDesc;
23 import org.gwe.persistence.model.JobInfo;
24 import org.gwe.persistence.model.live.OrderLive;
25
26
27
28
29
30 public class ComposedOrderDescriptor<DRP_TYPE> extends OrderDescriptor {
31
32 private List<OrderDescriptor> descriptors;
33
34 public final void addDescriptor(OrderDescriptor desc) {
35 descriptors.add(desc);
36 }
37
38 public List generateJobDescriptors(DaemonConfigDesc config) throws Exception {
39 List<JobInfo> results = new ArrayList<JobInfo>();
40 for (OrderDescriptor desc : descriptors)
41 results.addAll(desc.generateJobDescriptors(config));
42 return results;
43 }
44
45 public List<String> generateCommands(DaemonConfigDesc config) throws Exception {
46 List<String> results = new ArrayList<String>();
47 for (OrderDescriptor desc : descriptors)
48 results.addAll(desc.generateCommands(config));
49 return results;
50 }
51
52 public String toString() {
53 String result = "";
54 for (OrderDescriptor desc : descriptors) result += desc.toString() + "\n";
55 return result;
56 }
57
58 public void initExecution(OrderLive orderRC) {
59
60 }
61
62 public void finalizeExecution(OrderLive orderRC) {
63
64 }
65
66 public List<String> getVarNames() {
67 return new ArrayList<String>();
68 }
69 }
70