Skip to content

Commit cab78ea

Browse files
authored
Merge pull request #34 from TAK-Product-Center/upstream/4.9-RELEASE-50
TAK Server 4.9-RELEASE-50
2 parents f08ca71 + a853246 commit cab78ea

File tree

391 files changed

+56366
-4006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

391 files changed

+56366
-4006
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ java -Xmx<value> -Dspring.profiles.active=messaging,duplicatelogs -jar ../build/
7474

7575
Run API
7676
```
77-
java -Xmx<value> -Dspring.profiles.active=api,duplicatelogs -jar ../build/libs/takserver-core-xyz.war
77+
java -Xmx<value> -Dspring.profiles.active=api,duplicatelogs -Dkeystore.pkcs12.legacy -jar ../build/libs/takserver-core-xyz.war
7878
```
7979

8080
Run Plugin Manager (useful when working on plugin capability)

src/build.gradle

+2-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ext {
5151

5252
allprojects {
5353

54-
apply plugin: 'java'
54+
apply plugin: 'java-library'
5555
apply plugin: 'eclipse'
5656
apply plugin: 'idea'
5757
// apply plugin: 'pmd'
@@ -99,8 +99,7 @@ subprojects {
9999
}
100100

101101
dependencies {
102-
classpath 'com.github.jengelman.gradle.plugins:shadow:' + gradle_shadow_version
103-
classpath 'gradle.plugin.org.openrepose:gradle-jaxb-plugin:2.5.0'
102+
classpath 'gradle.plugin.com.github.johnrengelman:shadow:' + gradle_shadow_version
104103
// classpath 'gradle.plugin.se.bjurr.violations:violations-gradle-plugin:1.52.2'
105104
// classpath 'com.github.jk1:gradle-license-report:1.17'
106105
}
-37.3 KB
Binary file not shown.
176 KB
Binary file not shown.

src/federation-common/build.gradle

+13-11
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,24 @@ apply plugin: 'maven-publish'
33
version = '0.0.1-SNAPSHOT'
44

55
dependencies {
6-
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: log4j_api_version
7-
compile group: 'org.apache.logging.log4j', name: 'log4j-to-slf4j', version: log4j_api_version
8-
compile group: 'org.slf4j', name: 'slf4j-api', version: slf4j_version
9-
compile group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4j_version
6+
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: log4j_api_version
7+
implementation group: 'org.apache.logging.log4j', name: 'log4j-to-slf4j', version: log4j_api_version
8+
implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j_version
9+
implementation group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4j_version
1010

11-
compile project(':takserver-fig-core')
11+
api project(':takserver-fig-core')
1212

1313
// Apache Ignite (cache and distributed service grid).
14-
// compile group: 'org.apache.ignite', name: 'ignite-spring', version: ignite_spring_version
15-
// compile group: 'org.apache.ignite', name: 'ignite-spring-cache-ext', version: ignite_spring_cache_version
16-
compile group: 'org.springframework', name: 'spring-beans', version: spring_version
17-
compile group: 'org.springframework', name: 'spring-context', version: spring_version
14+
// implementation group: 'org.apache.ignite', name: 'ignite-spring', version: ignite_spring_version
15+
// implementation group: 'org.apache.ignite', name: 'ignite-spring-cache-ext', version: ignite_spring_cache_version
16+
implementation group: 'org.springframework', name: 'spring-beans', version: spring_version
17+
implementation group: 'org.springframework', name: 'spring-context', version: spring_version
1818

1919

20-
compile group: 'org.apache.ignite', name: 'ignite-kubernetes', version: ignite_version
21-
compile group: 'org.apache.ignite', name: 'ignite-slf4j', version: ignite_version
20+
implementation group: 'org.apache.ignite', name: 'ignite-kubernetes', version: ignite_version
21+
implementation group: 'org.apache.ignite', name: 'ignite-slf4j', version: ignite_version
22+
implementation 'org.apache.commons:commons-lang3:' + commons_lang_version
23+
implementation group: 'commons-codec', name: 'commons-codec', version: commons_codec_version
2224
}
2325

2426
compileJava {

src/federation-common/src/main/java/tak/server/federation/FederateEdge.java

+56-15
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,69 @@
1717
* Filter Expression - the filter expression of this edge.
1818
*/
1919
public class FederateEdge {
20+
21+
public enum GroupFilterType {
22+
ALL, ALLOWED, DISALLOWED, ALLOWED_AND_DISALLOWED
23+
24+
}
25+
26+
public static GroupFilterType getGroupFilterType(String name) {
27+
if ("allGroups".equals(name.toLowerCase())) {
28+
return GroupFilterType.ALL;
29+
}
30+
31+
if ("allowed".equals(name.toLowerCase())) {
32+
return GroupFilterType.ALLOWED;
33+
}
34+
35+
if ("disallowed".equals(name.toLowerCase())) {
36+
return GroupFilterType.DISALLOWED;
37+
}
38+
39+
if ("allowedanddisallowed".equals(name.toLowerCase())) {
40+
return GroupFilterType.ALLOWED_AND_DISALLOWED;
41+
}
42+
43+
return GroupFilterType.ALL;
44+
}
45+
2046
private final FederateIdentity source;
2147
private final FederateIdentity destination;
2248
private final Set<FederationFilter> filterSet;
2349
private final String filterExpression;
50+
private final Set<String> allowedGroups;
51+
private final Set<String> disallowedGroups;
52+
private final GroupFilterType filterType;
2453

2554
public FederateEdge(FederateIdentity source, FederateIdentity destination,
26-
String filterExpression) {
55+
String filterExpression, Set<String> allowedGroups, Set<String> disallowedGroups,
56+
GroupFilterType filterType) {
2757
this.source = source;
2858
this.destination = destination;
59+
2960
filterSet = new HashSet<>();
3061
this.filterExpression = filterExpression;
62+
63+
this.allowedGroups = allowedGroups;
64+
this.disallowedGroups = disallowedGroups;
65+
this.filterType = filterType;
3166
}
67+
68+
69+
70+
public Set<String> getAllowedGroups() {
71+
return allowedGroups;
72+
}
73+
74+
public Set<String> getDisallowedGroups() {
75+
return disallowedGroups;
76+
}
3277

33-
public FederateIdentity getSourceIdentity() {
78+
public GroupFilterType getFilterType() {
79+
return filterType;
80+
}
81+
82+
public FederateIdentity getSourceIdentity() {
3483
return source;
3584
}
3685

@@ -75,17 +124,9 @@ public String getFilterExpression() {
75124
}
76125

77126
@Override
78-
public String toString() {
79-
StringBuilder builder = new StringBuilder(67);
80-
builder.append("FederateEdge [source=")
81-
.append(source)
82-
.append(", destination=")
83-
.append(destination)
84-
.append(", filterSet=")
85-
.append(filterSet)
86-
.append(", filterExpression=")
87-
.append(filterExpression)
88-
.append(']');
89-
return builder.toString();
90-
}
127+
public String toString() {
128+
return "FederateEdge [source=" + source + ", destination=" + destination + ", filterSet=" + filterSet
129+
+ ", filterExpression=" + filterExpression + ", allowedGroups=" + allowedGroups + ", disallowedGroups="
130+
+ disallowedGroups + ", filterType=" + filterType + "]";
131+
}
91132
}

src/federation-common/src/main/java/tak/server/federation/FederationPolicyGraph.java

+18-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import java.util.Map;
66
import java.util.Set;
77

8+
import tak.server.federation.hub.policy.FederationPolicyGraphImpl.FederationPolicyReachabilityHolder;
9+
810
/*
911
* Interface for a FederationPolicyGraph object to represent a federation
1012
* policy as defined by the federation policy schema.
@@ -109,16 +111,30 @@ public boolean isReachable(String sourceUid,
109111
* has a valid path to. Throws FederationException if the
110112
* given source node does not exist.
111113
*/
112-
public Set<Federate> allReachableFederates(FederationNode source)
114+
public FederationPolicyReachabilityHolder allReachableFederates(FederationNode source)
113115
throws FederationException;
114116

115117
/*
116118
* Returns the set of all nodes that the given source node
117119
* indicated by the sourceUid has a valid path to. Throws
118120
* FederationException if the given source node does not exist.
119121
*/
120-
public Set<Federate> allReachableFederates(String sourceUid)
122+
public FederationPolicyReachabilityHolder allReachableFederates(String sourceUid)
121123
throws FederationException;
124+
125+
/*
126+
* Returns the set of all nodes that have a valid path to
127+
* the source node. Throws FederationException if the
128+
* given source node does not exist.
129+
*/
130+
Set<Federate> allReceivableFederates(FederationNode source) throws FederationException;
131+
132+
/*
133+
* Returns the set of all nodes that have a valid path to
134+
* the node with the given sourceUid. Throws FederationException if the
135+
* given source node does not exist.
136+
*/
137+
Set<Federate> allReceivableFederates(String sourceUid) throws FederationException;
122138

123139
/* Operations on edges. */
124140

0 commit comments

Comments
 (0)