Release v2.2.0-beta4
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
<groupId>com.fizzgate</groupId>
|
||||
<artifactId>fizz-bootstrap</artifactId>
|
||||
<version>2.2.0-beta3</version>
|
||||
<version>2.2.0-beta4</version>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>fizz-gateway-community</artifactId>
|
||||
<groupId>com.fizzgate</groupId>
|
||||
<version>2.2.0-beta3</version>
|
||||
<version>2.2.0-beta4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>fizz-gateway-community</artifactId>
|
||||
<groupId>com.fizzgate</groupId>
|
||||
<version>2.2.0-beta3</version>
|
||||
<version>2.2.0-beta4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -181,13 +181,28 @@ public class ResourceRateLimitConfigService {
|
||||
return resourceRateLimitConfigMap;
|
||||
}
|
||||
|
||||
// _global, service, app, ip, ip+service
|
||||
public void getParentsTo(String resource, List<String> parentList) {
|
||||
String app = null, ip = null, node = null, service = null, path = null;
|
||||
ResourceRateLimitConfig c = resourceRateLimitConfigMap.get(resource);
|
||||
if (c == null) {
|
||||
node = ResourceRateLimitConfig.getNode(resource);
|
||||
if (node != null && node.equals(ResourceRateLimitConfig.NODE)) {
|
||||
} else {
|
||||
service = ResourceRateLimitConfig.getService(resource);
|
||||
if (service != null) {
|
||||
app = ResourceRateLimitConfig.getApp(resource);
|
||||
ip = ResourceRateLimitConfig.getIp(resource);
|
||||
if (service == null) {
|
||||
parentList.add(ResourceRateLimitConfig.NODE_RESOURCE);
|
||||
} else {
|
||||
if (ip == null) {
|
||||
parentList.add(ResourceRateLimitConfig.NODE_RESOURCE);
|
||||
} else {
|
||||
String r = ResourceRateLimitConfig.buildResourceId(null, ip, null, null, null);
|
||||
parentList.add(r);
|
||||
parentList.add(ResourceRateLimitConfig.NODE_RESOURCE);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
@@ -211,7 +226,8 @@ public class ResourceRateLimitConfigService {
|
||||
ResourceRateLimitConfig.buildResourceIdTo(b, app, null, null, service, null);
|
||||
checkRateLimitConfigAndAddTo(b, parentList);
|
||||
ResourceRateLimitConfig.buildResourceIdTo(b, app, null, null, null, null);
|
||||
checkRateLimitConfigAndAddTo(b, parentList);
|
||||
// checkRateLimitConfigAndAddTo(b, parentList);
|
||||
to(parentList, b);
|
||||
} else if (service != null) {
|
||||
ResourceRateLimitConfig.buildResourceIdTo(b, app, null, null, null, null);
|
||||
checkRateLimitConfigAndAddTo(b, parentList);
|
||||
@@ -221,9 +237,11 @@ public class ResourceRateLimitConfigService {
|
||||
if (ip != null) {
|
||||
if (path != null) {
|
||||
ResourceRateLimitConfig.buildResourceIdTo(b, null, ip, null, service, null);
|
||||
checkRateLimitConfigAndAddTo(b, parentList);
|
||||
// checkRateLimitConfigAndAddTo(b, parentList);
|
||||
to(parentList, b);
|
||||
ResourceRateLimitConfig.buildResourceIdTo(b, null, ip, null, null, null);
|
||||
checkRateLimitConfigAndAddTo(b, parentList);
|
||||
// checkRateLimitConfigAndAddTo(b, parentList);
|
||||
to(parentList, b);
|
||||
} else if (service != null) {
|
||||
ResourceRateLimitConfig.buildResourceIdTo(b, null, ip, null, null, null);
|
||||
checkRateLimitConfigAndAddTo(b, parentList);
|
||||
@@ -232,13 +250,17 @@ public class ResourceRateLimitConfigService {
|
||||
|
||||
if (path != null) {
|
||||
ResourceRateLimitConfig.buildResourceIdTo(b, null, null, null, service, null);
|
||||
parentList.add(b.toString());
|
||||
b.delete(0, b.length());
|
||||
to(parentList, b);
|
||||
}
|
||||
|
||||
parentList.add(ResourceRateLimitConfig.NODE_RESOURCE);
|
||||
}
|
||||
|
||||
private void to(List<String> parentList, StringBuilder b) {
|
||||
parentList.add(b.toString());
|
||||
b.delete(0, b.length());
|
||||
}
|
||||
|
||||
private void checkRateLimitConfigAndAddTo(StringBuilder resourceStringBuilder, List<String> resourceList) {
|
||||
String r = resourceStringBuilder.toString();
|
||||
ResourceRateLimitConfig c = resourceRateLimitConfigMap.get(r);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>fizz-gateway-community</artifactId>
|
||||
<groupId>com.fizzgate</groupId>
|
||||
<version>2.2.0-beta3</version>
|
||||
<version>2.2.0-beta4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>fizz-gateway-community</artifactId>
|
||||
<groupId>com.fizzgate</groupId>
|
||||
<version>2.2.0-beta3</version>
|
||||
<version>2.2.0-beta4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
Reference in New Issue
Block a user