Repository navigation
Expand file tree
/
Copy pathdeployment_AllAppsScps_1.java
More file actions
90 lines (73 loc) · 2.27 KB
/
Copy pathdeployment_AllAppsScps_1.java
File metadata and controls
90 lines (73 loc) · 2.27 KB
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
////////EnsembleMembership/////////
@Membership
// all MemberGroup annotations into a single Members annotation
@Members({
// the App group is aggregated from the ownerId knowledge primitive object
@MemberGroup(identifier="App", aggregator="ownerId", size=5),
// the Scp group is pre-generated by the framework with middleware-supplied latencies
@MemberGroup(identifier="Scp", isBestLatencyLinkageGroup=true, size=5)
})
public static Boolean membership(
// AppComponent coordinator
@In("coord.id") String cAppId,
@In("coord.scpId") String cAppScpId,
@In("coord.isDeployed") Boolean cAppIsDeployed,
// AppComponent members
@In("members.App.id") List<String> msAppIds,
@In("members.App.scpId") List<String> msAppScpIds,
@In("members.App.isDeployed") List<Boolean> msAppIsDeployed,
// ScpComponent members
@In("members.Scp.id") List<String> msScpIds,
@In("members.Scp.appIds") List<List<String>> msScpAppIds
) {
// if all AppComponents have not been deployed yet
// we suppose the input members arrays are not empty as being injected before the call
if (!cAppIsDeployed &&
!msAppIsDeployed.contains(false)){
return true;
}
return null;
}
////////AppComponent/////////
public class AppComponent extends Component {
public final static long serialVersionUID = 1L;
/**
* id of the SCP instance which the application component is processed by
*/
public String scpId;
/**
* flag for deployment
*/
public Boolean isDeployed;
//...
}
////////ScpComponent/////////
public class ScpComponent extends NetworkComponent {
public final static long serialVersionUID = 1L;
/**
* id of the application nodes which are linked to the scp
*/
public List<String> appIds;
//...
}
////////NetworkComponent/////////
public class NetworkComponent extends Component {
private static final long serialVersionUID = 1L;
public ENetworkId networkId; // = which network does the component belong to
}
////////ENetworkId/////////
public enum ENetworkId {
LMU_MUNICH,
IMT_LUCCA,
EN_GARDEN
}
////////IdListType/////////
public class IdListType extends AbstractIdType {
public List<String> idList;
public IdListType(List<String> idList) {
this.idList = idList;
}
}
////////AbstractListType/////////
public abstract class AbstractIdType {
}