org.slf4j
diff --git a/shenyu-client-java-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanEventListener.java b/shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanEventListener.java
similarity index 95%
rename from shenyu-client-java-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanEventListener.java
rename to shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanEventListener.java
index 59891e1..816a511 100644
--- a/shenyu-client-java-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanEventListener.java
+++ b/shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanEventListener.java
@@ -22,18 +22,18 @@
import org.apache.shenyu.client.core.client.AbstractContextRefreshedEventListener;
import org.apache.shenyu.client.core.constant.ShenyuClientConstants;
import org.apache.shenyu.client.core.disruptor.ShenyuClientRegisterEventPublisher;
+import org.apache.shenyu.client.core.dto.MetaDataRegisterDTO;
+import org.apache.shenyu.client.core.dto.URIRegisterDTO;
+import org.apache.shenyu.client.core.enums.ApiHttpMethodEnum;
+import org.apache.shenyu.client.core.enums.EventType;
+import org.apache.shenyu.client.core.enums.RpcTypeEnum;
import org.apache.shenyu.client.core.exception.ShenyuClientIllegalArgumentException;
+import org.apache.shenyu.client.core.register.ShenyuClientRegisterRepository;
+import org.apache.shenyu.client.core.register.config.ShenyuClientConfig;
+import org.apache.shenyu.client.core.utils.GsonUtils;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsClient;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsService;
import org.apache.shenyu.client.tars.common.dto.TarsRpcExt;
-import org.apache.shenyu.common.enums.ApiHttpMethodEnum;
-import org.apache.shenyu.common.enums.RpcTypeEnum;
-import org.apache.shenyu.common.utils.GsonUtils;
-import org.apache.shenyu.register.client.api.ShenyuClientRegisterRepository;
-import org.apache.shenyu.register.common.config.ShenyuClientConfig;
-import org.apache.shenyu.register.common.dto.MetaDataRegisterDTO;
-import org.apache.shenyu.register.common.dto.URIRegisterDTO;
-import org.apache.shenyu.register.common.enums.EventType;
import org.javatuples.Sextet;
import org.springframework.aop.support.AopUtils;
import org.springframework.context.ApplicationContext;
diff --git a/shenyu-client-java-tars/src/main/java/org/apache/shenyu/client/tars/common/annotation/ShenyuTarsClient.java b/shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/common/annotation/ShenyuTarsClient.java
similarity index 100%
rename from shenyu-client-java-tars/src/main/java/org/apache/shenyu/client/tars/common/annotation/ShenyuTarsClient.java
rename to shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/common/annotation/ShenyuTarsClient.java
diff --git a/shenyu-client-java-tars/src/main/java/org/apache/shenyu/client/tars/common/annotation/ShenyuTarsService.java b/shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/common/annotation/ShenyuTarsService.java
similarity index 100%
rename from shenyu-client-java-tars/src/main/java/org/apache/shenyu/client/tars/common/annotation/ShenyuTarsService.java
rename to shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/common/annotation/ShenyuTarsService.java
diff --git a/shenyu-client-java-tars/src/main/java/org/apache/shenyu/client/tars/common/dto/TarsRpcExt.java b/shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/common/dto/TarsRpcExt.java
similarity index 100%
rename from shenyu-client-java-tars/src/main/java/org/apache/shenyu/client/tars/common/dto/TarsRpcExt.java
rename to shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/common/dto/TarsRpcExt.java
diff --git a/shenyu-client-java-tars/src/test/java/org/apache/shenyu/client/tars/TarsRpcExtTest.java b/shenyu-client/shenyu-client-tars/src/test/java/org/apache/shenyu/client/tars/TarsRpcExtTest.java
similarity index 100%
rename from shenyu-client-java-tars/src/test/java/org/apache/shenyu/client/tars/TarsRpcExtTest.java
rename to shenyu-client/shenyu-client-tars/src/test/java/org/apache/shenyu/client/tars/TarsRpcExtTest.java
diff --git a/shenyu-client-java-tars/src/test/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessorTest.java b/shenyu-client/shenyu-client-tars/src/test/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessorTest.java
similarity index 93%
rename from shenyu-client-java-tars/src/test/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessorTest.java
rename to shenyu-client/shenyu-client-tars/src/test/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessorTest.java
index 26bacfa..a81395e 100644
--- a/shenyu-client-java-tars/src/test/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessorTest.java
+++ b/shenyu-client/shenyu-client-tars/src/test/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessorTest.java
@@ -17,16 +17,16 @@
package org.apache.shenyu.client.tars;
+import org.apache.shenyu.client.core.enums.RpcTypeEnum;
import org.apache.shenyu.client.core.exception.ShenyuClientIllegalArgumentException;
+import org.apache.shenyu.client.core.register.ShenyuClientRegisterRepository;
import org.apache.shenyu.client.core.register.ShenyuClientRegisterRepositoryFactory;
+import org.apache.shenyu.client.core.register.config.ShenyuClientConfig;
+import org.apache.shenyu.client.core.register.config.ShenyuClientConfig.ClientPropertiesConfig;
+import org.apache.shenyu.client.core.register.config.ShenyuRegisterCenterConfig;
+import org.apache.shenyu.client.core.utils.RegisterUtils;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsClient;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsService;
-import org.apache.shenyu.common.enums.RpcTypeEnum;
-import org.apache.shenyu.register.client.api.ShenyuClientRegisterRepository;
-import org.apache.shenyu.register.client.http.utils.RegisterUtils;
-import org.apache.shenyu.register.common.config.ShenyuClientConfig;
-import org.apache.shenyu.register.common.config.ShenyuClientConfig.ClientPropertiesConfig;
-import org.apache.shenyu.register.common.config.ShenyuRegisterCenterConfig;
import org.junit.Assert;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.MethodOrderer;
diff --git a/shenyu-client-java-dubbo/pom.xml b/shenyu-client/shenyu-client-websocket/pom.xml
similarity index 82%
rename from shenyu-client-java-dubbo/pom.xml
rename to shenyu-client/shenyu-client-websocket/pom.xml
index 5e5f176..802f70b 100644
--- a/shenyu-client-java-dubbo/pom.xml
+++ b/shenyu-client/shenyu-client-websocket/pom.xml
@@ -19,15 +19,14 @@
org.apache.shenyu
- shenyu-client-java
- 2.7.1-SNAPSHOT
+ shenyu-client
+ 2.7.0.1-jdk8-SNAPSHOT
4.0.0
- shenyu-client-java-dubbo
+ shenyu-client-websocket
pom
- shenyu-client-java-dubbo-common
- shenyu-client-java-apache-dubbo
+ shenyu-client-spring-websocket
diff --git a/shenyu-client-java-http/shenyu-client-java-springmvc/pom.xml b/shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/pom.xml
similarity index 67%
rename from shenyu-client-java-http/shenyu-client-java-springmvc/pom.xml
rename to shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/pom.xml
index c195633..e5cfc24 100644
--- a/shenyu-client-java-http/shenyu-client-java-springmvc/pom.xml
+++ b/shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/pom.xml
@@ -19,47 +19,16 @@
org.apache.shenyu
- shenyu-client-java-http
- 2.7.1-SNAPSHOT
+ shenyu-client-websocket
+ 2.7.0.1-jdk8-SNAPSHOT
4.0.0
- shenyu-client-java-springmvc
+ shenyu-client-spring-websocket
-
- org.hamcrest
- hamcrest
- 2.2
- test
-
-
- org.mockito
- mockito-junit-jupiter
- 4.11.0
- test
-
-
- org.mockito
- mockito-inline
- 3.3.3
- test
-
-
- org.junit.jupiter
- junit-jupiter-api
- 5.5.2
- test
-
-
-
- junit
- junit
- 4.13.2
- test
-
org.apache.shenyu
- shenyu-client-java-core
+ shenyu-client-core
${project.version}
@@ -82,6 +51,24 @@
spring-web
provided
-
+
+ javax.websocket
+ javax.websocket-api
+ provided
+
+
+ javax.servlet
+ javax.servlet-api
+ provided
+
+
+ org.springframework
+ spring-websocket
+ test
+
+
+ org.apache.tomcat.embed
+ tomcat-embed-websocket
+
diff --git a/shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/annotation/ShenyuServerEndpoint.java b/shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/annotation/ShenyuServerEndpoint.java
similarity index 100%
rename from shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/annotation/ShenyuServerEndpoint.java
rename to shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/annotation/ShenyuServerEndpoint.java
diff --git a/shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/annotation/ShenyuSpringWebSocketClient.java b/shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/annotation/ShenyuSpringWebSocketClient.java
similarity index 100%
rename from shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/annotation/ShenyuSpringWebSocketClient.java
rename to shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/annotation/ShenyuSpringWebSocketClient.java
diff --git a/shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/ShenyuServerEndpointerExporter.java b/shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/ShenyuServerEndpointerExporter.java
similarity index 93%
rename from shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/ShenyuServerEndpointerExporter.java
rename to shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/ShenyuServerEndpointerExporter.java
index 173a343..324e440 100644
--- a/shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/ShenyuServerEndpointerExporter.java
+++ b/shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/ShenyuServerEndpointerExporter.java
@@ -19,7 +19,6 @@
import java.util.Objects;
import org.apache.shenyu.client.spring.websocket.annotation.ShenyuServerEndpoint;
-import org.apache.shenyu.common.exception.ShenyuException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.annotation.AnnotatedElementUtils;
@@ -60,7 +59,7 @@ protected ServerContainer getServerContainer() {
@Override
protected void initServletContext(final ServletContext servletContext) {
if (Objects.isNull(this.serverContainer)) {
- this.serverContainer = (ServerContainer) servletContext.getAttribute("javax.websocket.server.ServerContainer");
+ this.serverContainer = (ServerContainer) servletContext.getAttribute("jakarta.websocket.server.ServerContainer");
}
}
@@ -76,7 +75,7 @@ protected boolean isContextRequired() {
public void registerEndpoint(final Class> pojo) {
ShenyuServerEndpoint annotation = AnnotatedElementUtils.findMergedAnnotation(pojo, ShenyuServerEndpoint.class);
if (Objects.isNull(annotation)) {
- throw new ShenyuException("Class missing annotation ShenyuServerEndpoint! class name: " + pojo.getName());
+ throw new RuntimeException("Class missing annotation ShenyuServerEndpoint! class name: " + pojo.getName());
}
String path = annotation.value();
@@ -87,7 +86,7 @@ public void registerEndpoint(final Class> pojo) {
configurator = annotation.configurator().getConstructor().newInstance();
} catch (ReflectiveOperationException ex) {
LOG.error("ShenyuServerEndpoint configurator init fail! Class name: {}, configurator name: {}", pojo.getName(), annotation.configurator().getName());
- throw new ShenyuException(ex);
+ throw new RuntimeException(ex);
}
}
ServerEndpointConfig sec = ServerEndpointConfig.Builder.create(pojo, path)
diff --git a/shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListener.java b/shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListener.java
similarity index 95%
rename from shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListener.java
rename to shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListener.java
index 338ad8d..ca0e7a3 100644
--- a/shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListener.java
+++ b/shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/main/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListener.java
@@ -22,18 +22,17 @@
import org.apache.shenyu.client.core.client.AbstractContextRefreshedEventListener;
import org.apache.shenyu.client.core.constant.ShenyuClientConstants;
import org.apache.shenyu.client.core.disruptor.ShenyuClientRegisterEventPublisher;
+import org.apache.shenyu.client.core.dto.MetaDataRegisterDTO;
+import org.apache.shenyu.client.core.dto.URIRegisterDTO;
+import org.apache.shenyu.client.core.enums.ApiHttpMethodEnum;
+import org.apache.shenyu.client.core.enums.EventType;
+import org.apache.shenyu.client.core.enums.RpcTypeEnum;
+import org.apache.shenyu.client.core.register.ShenyuClientRegisterRepository;
+import org.apache.shenyu.client.core.register.config.ShenyuClientConfig;
+import org.apache.shenyu.client.core.utils.PathUtils;
import org.apache.shenyu.client.core.utils.PortUtils;
import org.apache.shenyu.client.spring.websocket.annotation.ShenyuServerEndpoint;
import org.apache.shenyu.client.spring.websocket.annotation.ShenyuSpringWebSocketClient;
-import org.apache.shenyu.common.enums.ApiHttpMethodEnum;
-import org.apache.shenyu.common.enums.RpcTypeEnum;
-import org.apache.shenyu.common.exception.ShenyuException;
-import org.apache.shenyu.common.utils.PathUtils;
-import org.apache.shenyu.register.client.api.ShenyuClientRegisterRepository;
-import org.apache.shenyu.register.common.config.ShenyuClientConfig;
-import org.apache.shenyu.register.common.dto.MetaDataRegisterDTO;
-import org.apache.shenyu.register.common.dto.URIRegisterDTO;
-import org.apache.shenyu.register.common.enums.EventType;
import org.javatuples.Sextet;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@@ -130,8 +129,8 @@ protected URIRegisterDTO buildURIRegisterDTO(final ApplicationContext context,
.eventType(EventType.REGISTER)
.namespaceId(namespaceId)
.build();
- } catch (ShenyuException e) {
- throw new ShenyuException(e.getMessage() + "please config ${shenyu.client.http.props.port} in xml/yml !");
+ } catch (Exception e) {
+ throw new RuntimeException(e.getMessage() + "please config ${shenyu.client.http.props.port} in xml/yml !");
}
}
diff --git a/shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/ShenyuServerEndpointerExporterTest.java b/shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/ShenyuServerEndpointerExporterTest.java
similarity index 96%
rename from shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/ShenyuServerEndpointerExporterTest.java
rename to shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/ShenyuServerEndpointerExporterTest.java
index cedfcc7..33c5525 100644
--- a/shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/ShenyuServerEndpointerExporterTest.java
+++ b/shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/ShenyuServerEndpointerExporterTest.java
@@ -18,7 +18,6 @@
package org.apache.shenyu.client.spring.websocket.init;
import org.apache.shenyu.client.spring.websocket.annotation.ShenyuServerEndpoint;
-import org.apache.shenyu.common.exception.ShenyuException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -111,7 +110,7 @@ public void registerEndpointTest() throws DeploymentException {
*/
@Test
public void registerEndpointMissingAnnotationTest() {
- assertThrows(ShenyuException.class, () -> exporter.registerEndpoint(pojo.getClass()));
+ assertThrows(RuntimeException.class, () -> exporter.registerEndpoint(pojo.getClass()));
verifyNoInteractions(serverContainer);
}
diff --git a/shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListenerTest.java b/shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListenerTest.java
similarity index 90%
rename from shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListenerTest.java
rename to shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListenerTest.java
index 9da0232..d49e450 100644
--- a/shenyu-client-java-websocket/shenyu-client-java-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListenerTest.java
+++ b/shenyu-client/shenyu-client-websocket/shenyu-client-spring-websocket/src/test/java/org/apache/shenyu/client/spring/websocket/init/SpringWebSocketClientEventListenerTest.java
@@ -17,16 +17,17 @@
package org.apache.shenyu.client.spring.websocket.init;
+import org.apache.shenyu.client.core.constant.Constants;
import org.apache.shenyu.client.core.constant.ShenyuClientConstants;
import org.apache.shenyu.client.core.disruptor.ShenyuClientRegisterEventPublisher;
+import org.apache.shenyu.client.core.dto.MetaDataRegisterDTO;
+import org.apache.shenyu.client.core.dto.URIRegisterDTO;
+import org.apache.shenyu.client.core.enums.RpcTypeEnum;
+import org.apache.shenyu.client.core.register.ShenyuClientRegisterRepository;
+import org.apache.shenyu.client.core.register.config.PropertiesConfig;
+import org.apache.shenyu.client.core.register.config.ShenyuClientConfig;
+import org.apache.shenyu.client.core.register.config.ShenyuClientConfig.ClientPropertiesConfig;
import org.apache.shenyu.client.spring.websocket.annotation.ShenyuSpringWebSocketClient;
-import org.apache.shenyu.common.enums.RpcTypeEnum;
-import org.apache.shenyu.register.client.api.ShenyuClientRegisterRepository;
-import org.apache.shenyu.register.common.config.PropertiesConfig;
-import org.apache.shenyu.register.common.config.ShenyuClientConfig;
-import org.apache.shenyu.register.common.config.ShenyuClientConfig.ClientPropertiesConfig;
-import org.apache.shenyu.register.common.dto.MetaDataRegisterDTO;
-import org.apache.shenyu.register.common.dto.URIRegisterDTO;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -116,7 +117,7 @@ public void testGetBeans() {
@Test
public void testBuildURIRegisterDTO() {
- URIRegisterDTO uriRegisterDTO = eventListener.buildURIRegisterDTO(applicationContext, Collections.emptyMap(), ShenyuClientConstants.SYS_DEFAULT_NAMESPACE_ID);
+ URIRegisterDTO uriRegisterDTO = eventListener.buildURIRegisterDTO(applicationContext, Collections.emptyMap(), Constants.SYS_DEFAULT_NAMESPACE_ID);
assertNotNull(uriRegisterDTO);
assertEquals("/contextPath", uriRegisterDTO.getContextPath());
assertEquals("appName", uriRegisterDTO.getAppName());
@@ -166,7 +167,7 @@ public void testBuildApiPath() throws NoSuchMethodException {
@Test
public void testBuildMetaDataDTO() throws NoSuchMethodException {
Method method = mockClass.getClass().getMethod("mockMethod");
- MetaDataRegisterDTO metaDataRegisterDTO = eventListener.buildMetaDataDTO(mockClass, annotation, SUPER_PATH, MockClass.class, method, ShenyuClientConstants.SYS_DEFAULT_NAMESPACE_ID);
+ MetaDataRegisterDTO metaDataRegisterDTO = eventListener.buildMetaDataDTO(mockClass, annotation, SUPER_PATH, MockClass.class, method, Constants.SYS_DEFAULT_NAMESPACE_ID);
assertNotNull(metaDataRegisterDTO);
}
diff --git a/shenyu-java-common/pom.xml b/shenyu-java-common/pom.xml
deleted file mode 100644
index 2541b20..0000000
--- a/shenyu-java-common/pom.xml
+++ /dev/null
@@ -1,157 +0,0 @@
-
-
-
-
-
- org.apache.shenyu
- shenyu-client-java
- 2.7.1-SNAPSHOT
-
- 4.0.0
- shenyu-java-common
-
-
-
- com.google.code.gson
- gson
-
-
-
- org.apache.commons
- commons-lang3
-
-
-
- com.fasterxml.jackson.core
- jackson-databind
-
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jdk8
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jsr310
-
-
-
- com.fasterxml.jackson.module
- jackson-module-parameter-names
-
-
-
- org.apache.commons
- commons-collections4
- ${commons-collections4.version}
-
-
-
- com.github.ben-manes.caffeine
- caffeine
-
-
- commons-codec
- commons-codec
-
-
-
- org.ow2.asm
- asm-tree
- ${asm.version}
-
-
-
- io.projectreactor.netty
- reactor-netty-core
-
-
-
- io.projectreactor.netty
- reactor-netty-http
-
-
-
- org.bouncycastle
- bcprov-jdk18on
- ${bcprov-jdk18on.version}
-
-
- org.slf4j
- slf4j-api
-
-
- org.slf4j
- jcl-over-slf4j
-
-
- com.google.code.findbugs
- jsr305
- 3.0.2
-
-
- com.google.guava
- guava
- 32.0.0-jre
-
-
- com.google.re2j
- re2j
-
-
-
-
- org.hamcrest
- hamcrest
- 2.2
- test
-
-
- org.mockito
- mockito-junit-jupiter
- 4.11.0
- test
-
-
- org.mockito
- mockito-inline
- 3.5.15
- test
-
-
- org.junit.jupiter
- junit-jupiter-api
- 5.8.2
- test
-
-
- org.junit.jupiter
- junit-jupiter-params
- 5.8.2
- test
-
-
-
- junit
- junit
- 4.13.2
- test
-
-
-
-
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/cache/MemorySafeLRUMap.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/cache/MemorySafeLRUMap.java
deleted file mode 100644
index ff344ec..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/cache/MemorySafeLRUMap.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.cache;
-
-import org.apache.commons.collections4.map.LRUMap;
-import org.apache.shenyu.common.concurrent.MemoryLimitCalculator;
-
-import javax.annotation.concurrent.NotThreadSafe;
-import java.util.Map;
-
-/**
- * The only difference between this class and {@link org.apache.commons.collections4.map.LRUMap}
- * is that it handles memory issues via {@link org.apache.shenyu.common.concurrent.MemoryLimitCalculator}.
- *
- * Note: this class is not thread safe! see https://github.com/apache/shenyu/issues/3929
- */
-@NotThreadSafe
-public class MemorySafeLRUMap extends LRUMap {
-
- private final int maxFreeMemory;
-
- public MemorySafeLRUMap(final int maxFreeMemory,
- final int initialSize) {
- super(MAXIMUM_CAPACITY, initialSize);
- this.maxFreeMemory = maxFreeMemory;
- }
-
- public MemorySafeLRUMap(final int maxFreeMemory,
- final int initialSize,
- final float loadFactor) {
- super(MAXIMUM_CAPACITY, initialSize, loadFactor);
- this.maxFreeMemory = maxFreeMemory;
- }
-
- public MemorySafeLRUMap(final int maxFreeMemory,
- final int initialSize,
- final float loadFactor,
- final boolean scanUntilRemovable) {
- super(MAXIMUM_CAPACITY, initialSize, loadFactor, scanUntilRemovable);
- this.maxFreeMemory = maxFreeMemory;
- }
-
- public MemorySafeLRUMap(final int maxFreeMemory,
- final Map extends K, ? extends V> map) {
- super(map);
- this.maxFreeMemory = maxFreeMemory;
- }
-
- public MemorySafeLRUMap(final int maxFreeMemory,
- final Map extends K, ? extends V> map,
- final boolean scanUntilRemovable) {
- super(map, scanUntilRemovable);
- this.maxFreeMemory = maxFreeMemory;
- }
-
- @Override
- public boolean isFull() {
- // when free memory less than certain value, consider it's full
- return size() > 0 && MemoryLimitCalculator.maxAvailable() < maxFreeMemory;
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/cache/MemorySafeWindowTinyLFUMap.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/cache/MemorySafeWindowTinyLFUMap.java
deleted file mode 100644
index 1500ae2..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/cache/MemorySafeWindowTinyLFUMap.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.cache;
-
-import com.github.benmanes.caffeine.cache.Cache;
-import com.github.benmanes.caffeine.cache.Caffeine;
-import org.apache.shenyu.common.concurrent.MemoryLimitCalculator;
-import org.apache.shenyu.common.concurrent.ShenyuThreadFactory;
-import org.apache.shenyu.common.constant.Constants;
-import org.checkerframework.checker.nullness.qual.NonNull;
-
-import javax.annotation.concurrent.ThreadSafe;
-import java.io.Serializable;
-import java.lang.ref.WeakReference;
-import java.util.AbstractMap;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArraySet;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * The differences between this class and {@link MemorySafeLRUMap}
- * is that this class is thread safe, and it use WindowTinyLFU algorithm
- * provided by caffeine which is better than LRU algorithm.
- */
-@ThreadSafe
-public class MemorySafeWindowTinyLFUMap extends AbstractMap implements Serializable {
-
- private static final long serialVersionUID = -3288161459386389022L;
-
- private static final AtomicBoolean GLOBAL = new AtomicBoolean(false);
-
- private static final Set>> ALL = new CopyOnWriteArraySet<>();
-
- private final int maxFreeMemory;
-
- private final Cache cache;
-
- public MemorySafeWindowTinyLFUMap(final int maxFreeMemory,
- final int initialSize) {
- this(maxFreeMemory, initialSize, Long.MAX_VALUE, Constants.LRU_MAP_MAXSIZE);
- }
-
- public MemorySafeWindowTinyLFUMap(final int maxFreeMemory,
- final int initialSize,
- final long expireAfterWrite,
- final long maximumSize) {
- this.maxFreeMemory = maxFreeMemory;
- //see https://github.com/ben-manes/caffeine/issues/776
- this.cache = Caffeine.newBuilder()
- .expireAfterWrite(expireAfterWrite, TimeUnit.MILLISECONDS)
- .maximumSize(maximumSize)
- .initialCapacity(initialSize)
- .build();
- }
-
- @Override
- public V get(final Object key) {
- return cache.getIfPresent(key);
- }
-
- @Override
- public V put(final K key, final V value) {
- checkAndScheduleRefresh(this);
- final V previous = cache.getIfPresent(key);
- cache.put(key, value);
- return previous;
- }
-
- @Override
- public V remove(final Object key) {
- final V previous = cache.getIfPresent(key);
- cache.invalidate(key);
- cache.cleanUp();
- return previous;
- }
-
- @Override
- public Set> entrySet() {
- return cache.asMap().entrySet();
- }
-
- /**
- * clean invalidated cache now.
- */
- public void cleanUp() {
- while (isFull()) {
- invalidate();
- }
- }
-
- /**
- * invalidate coldest cache now.
- */
- public void invalidate() {
- cache.policy().eviction().ifPresent(eviction -> {
- final Map<@NonNull K, @NonNull V> coldest = eviction.coldest(1);
- if (coldest.size() == 0) {
- return;
- }
- Optional.ofNullable(coldest.entrySet().iterator().next())
- .ifPresent(entry -> cache.invalidate(entry.getKey()));
- });
- }
-
- /**
- * whether to full.
- *
- * @return true if it's full
- */
- public boolean isFull() {
- // when free memory less than certain value, consider it's full
- return cache.estimatedSize() > 0 && MemoryLimitCalculator.maxAvailable() < maxFreeMemory;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof MemorySafeWindowTinyLFUMap)) {
- return false;
- }
- if (!super.equals(o)) {
- return false;
- }
- MemorySafeWindowTinyLFUMap, ?> that = (MemorySafeWindowTinyLFUMap, ?>) o;
- return maxFreeMemory == that.maxFreeMemory && Objects.equals(cache, that.cache);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(super.hashCode(), maxFreeMemory, cache);
- }
-
- private static void checkAndScheduleRefresh(final MemorySafeWindowTinyLFUMap, ?> map) {
- ALL.add(new WeakReference<>(map));
- if (!GLOBAL.get()) {
- refresh();
- if (GLOBAL.compareAndSet(false, true)) {
- ScheduledExecutorService scheduledExecutorService =
- new ScheduledThreadPoolExecutor(1, ShenyuThreadFactory.create("Shenyu-Memory-Safe-Lru-Map", false));
- // check every 50 ms to improve performance
- scheduledExecutorService.scheduleWithFixedDelay(MemorySafeWindowTinyLFUMap::refresh, 50, 50, TimeUnit.MILLISECONDS);
- Runtime.getRuntime().addShutdownHook(new Thread(() -> {
- GLOBAL.set(false);
- scheduledExecutorService.shutdown();
- }));
- }
- }
- }
-
- private static void refresh() {
- // try to clear weak reference
- for (WeakReference> weakReference : ALL) {
- MemorySafeWindowTinyLFUMap, ?> cacheMap = weakReference.get();
- if (Objects.isNull(cacheMap)) {
- ALL.remove(weakReference);
- }
- }
- // if jvm memory is full, try to release memory from caffine
- boolean anyFull = ALL.stream().map(WeakReference::get).filter(Objects::nonNull)
- .anyMatch(MemorySafeWindowTinyLFUMap::isFull);
- while (anyFull) {
- ALL.stream().map(WeakReference::get).filter(Objects::nonNull).forEach(MemorySafeWindowTinyLFUMap::invalidate);
- anyFull = ALL.stream().map(WeakReference::get).filter(Objects::nonNull)
- .anyMatch(MemorySafeWindowTinyLFUMap::isFull);
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/cache/WindowTinyLFUMap.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/cache/WindowTinyLFUMap.java
deleted file mode 100644
index 826b645..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/cache/WindowTinyLFUMap.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.cache;
-
-import com.github.benmanes.caffeine.cache.Cache;
-import com.github.benmanes.caffeine.cache.Caffeine;
-
-import javax.annotation.concurrent.ThreadSafe;
-import java.io.Serializable;
-import java.util.AbstractMap;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-/**
- * this cache is provided by caffeine, the cache has two implements including weak-key cache and strong-key cache.
- * the weak-key cache applies to scenarios where objects can be collected. when memory lock causes full gc, the weakKey will collect by gc.
- * the strong-key cache applies to immutable cache object data, and the user determines the cache size.
- * about the weak-key cache and strong-key cache, please refer to:
- * caffeine cache ISSUES #776
- */
-@ThreadSafe
-public class WindowTinyLFUMap extends AbstractMap implements Serializable {
-
- private static final long serialVersionUID = 2176631265536166614L;
-
- private final Cache cache;
-
- /**
- * build caffeine cache.
- *
- * @param maximumSize maximumSize
- */
- public WindowTinyLFUMap(final long maximumSize) {
- this.cache = Caffeine.newBuilder()
- .maximumSize(maximumSize)
- .build();
- }
-
- /**
- * initial caffeine cache include WeakReference cache and StrongReference cache.
- *
- * when the weakKey is true that means using weakKeys cache, gc will collect the weak key, please refer to:
- * com.github.benmanes.caffeine.cache.References.WeakKeyReference
- *
- * when the weakKey is false, use strong reference, jvm maybe throw oom-error.
- *
- * {@code Map strongMap = new WindowTinyLFUMap<>(100, 100, Boolean.FALSE);
- * strongMap.put(new String("abc"), 1);
- * strongMap.put(new String("abc"), 1);
- * assert strongMap.get("abc") != null;
- *
- * Map strongMap = new WindowTinyLFUMap<>(100, 100, Boolean.TRUE);
- * strongMap.put(new String("abc"), 1);
- * strongMap.put(new String("abc"), 1);
- * assert strongMap.get("abc") == null;
- * }
- *
- * @param initialCapacity initial capacity
- * @param maximumSize maximum size
- * @param weakKey weak key
- */
- public WindowTinyLFUMap(final int initialCapacity, final long maximumSize, final Boolean weakKey) {
- if (Boolean.TRUE.equals(weakKey)) {
- this.cache = Caffeine.newBuilder()
- .weakKeys()
- .initialCapacity(initialCapacity)
- .maximumSize(maximumSize)
- .build();
- } else {
- this.cache = Caffeine.newBuilder()
- .initialCapacity(initialCapacity)
- .maximumSize(maximumSize)
- .build();
- }
- }
-
- public WindowTinyLFUMap(final int initialSize, final long expireAfterWrite, final long maximumSize, final Boolean weakKey) {
- if (Boolean.TRUE.equals(weakKey)) {
- this.cache = Caffeine.newBuilder()
- .weakKeys()
- .initialCapacity(initialSize)
- .expireAfterWrite(expireAfterWrite, TimeUnit.MILLISECONDS)
- .maximumSize(maximumSize)
- .build();
- } else {
- this.cache = Caffeine.newBuilder()
- .initialCapacity(initialSize)
- .expireAfterWrite(expireAfterWrite, TimeUnit.MILLISECONDS)
- .maximumSize(maximumSize)
- .build();
- }
-
- }
-
- @Override
- public V put(final K key, final V value) {
- V v = cache.getIfPresent(key);
- cache.put(key, value);
- return v;
- }
-
- @Override
- public V get(final Object key) {
- return cache.getIfPresent(key);
- }
-
- @Override
- public V remove(final Object key) {
- V value = cache.getIfPresent(key);
- cache.invalidate(key);
- cache.cleanUp();
- return value;
- }
-
- @Override
- public void clear() {
- this.cache.invalidateAll();
- this.cache.cleanUp();
- }
-
- @Override
- public int size() {
- return this.cache.asMap().entrySet().size();
- }
-
- @Override
- public Set> entrySet() {
- return cache.asMap().entrySet();
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/AbortPolicy.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/AbortPolicy.java
deleted file mode 100644
index 758cd0f..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/AbortPolicy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.util.Queue;
-
-/**
- * A handler for rejected element that throws a
- * {@code RejectException}.
- */
-public class AbortPolicy implements Rejector {
-
- @Override
- public void reject(final E e, final Queue queue) {
- throw new RejectException("no more memory can be used !");
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/DiscardOldestPolicy.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/DiscardOldestPolicy.java
deleted file mode 100644
index 44a8fc0..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/DiscardOldestPolicy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.util.Queue;
-
-/**
- * A handler for rejected element that discards the oldest element.
- */
-public class DiscardOldestPolicy implements Rejector {
-
- @Override
- public void reject(final E e, final Queue queue) {
- queue.poll();
- queue.offer(e);
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/DiscardPolicy.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/DiscardPolicy.java
deleted file mode 100644
index d7e14c9..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/DiscardPolicy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.util.Queue;
-
-/**
- * A handler for rejected element that silently discards the
- * rejected element.
- */
-public class DiscardPolicy implements Rejector {
-
- @Override
- public void reject(final E e, final Queue queue) {
-
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/EagerExecutorService.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/EagerExecutorService.java
deleted file mode 100644
index 94c4706..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/EagerExecutorService.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.util.concurrent.ExecutorService;
-
-/**
- * EagerExecutorService.
- */
-public interface EagerExecutorService extends ExecutorService {
-
- /**
- * Returns the current number of threads in the pool.
- *
- * @return the number of threads
- */
- int getPoolSize();
-
- /**
- * Returns the approximate number of threads that are actively
- * executing tasks.
- *
- * @return the number of threads
- */
- int getActiveCount();
-
- /**
- * Returns the maximum allowed number of threads.
- *
- * @return the maximum allowed number of threads
- */
- int getMaximumPoolSize();
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimitCalculator.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimitCalculator.java
deleted file mode 100644
index 8688c27..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimitCalculator.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * {@link java.lang.Runtime#freeMemory()} technology is used to calculate the
- * memory limit by using the percentage of the current maximum available memory,
- * which can be used with {@link org.apache.shenyu.common.concurrent.MemoryLimiter}.
- *
- * @see org.apache.shenyu.common.concurrent.MemoryLimiter
- */
-public class MemoryLimitCalculator {
-
- private static volatile long maxAvailable;
-
- private static final AtomicBoolean REFRESH_STARTED = new AtomicBoolean(false);
-
- private static void checkAndScheduleRefresh() {
- if (!REFRESH_STARTED.get()) {
- // see https://github.com/apache/dubbo/pull/10178
- refresh();
- if (REFRESH_STARTED.compareAndSet(false, true)) {
- ScheduledExecutorService scheduledExecutorService =
- new ScheduledThreadPoolExecutor(1, ShenyuThreadFactory.create("Shenyu-Memory-Calculator-", false));
- // check every 50 ms to improve performance
- scheduledExecutorService.scheduleWithFixedDelay(MemoryLimitCalculator::refresh, 50, 50, TimeUnit.MILLISECONDS);
- Runtime.getRuntime().addShutdownHook(new Thread(() -> {
- REFRESH_STARTED.set(false);
- scheduledExecutorService.shutdown();
- }
- ));
- }
- }
- }
-
- private static void refresh() {
- maxAvailable = Runtime.getRuntime().freeMemory();
- }
-
- /**
- * Get the maximum available memory of the current JVM.
- *
- * @return maximum available memory
- */
- public static long maxAvailable() {
- checkAndScheduleRefresh();
- return maxAvailable;
- }
-
- /**
- * Take the current JVM's maximum available memory
- * as a percentage of the result as the limit.
- *
- * @param percentage percentage
- * @return available memory
- */
- public static long calculate(final float percentage) {
- if (percentage <= 0 || percentage > 1) {
- throw new IllegalArgumentException();
- }
- checkAndScheduleRefresh();
- return (long) (maxAvailable() * percentage);
- }
-
- /**
- * By default, it takes 80% of the maximum available memory of the current JVM.
- *
- * @return available memory
- */
- public static long defaultLimit() {
- checkAndScheduleRefresh();
- return (long) (maxAvailable() * 0.8);
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimitedLinkedBlockingQueue.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimitedLinkedBlockingQueue.java
deleted file mode 100644
index ea6ec11..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimitedLinkedBlockingQueue.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.lang.instrument.Instrumentation;
-import java.util.Collection;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Can completely solve the OOM problem caused by {@link java.util.concurrent.LinkedBlockingQueue}.
- *
- * @see org.apache.shenyu.common.concurrent.MemoryLimiter
- * @see org.apache.shenyu.common.concurrent.MemoryLimitCalculator
- */
-public class MemoryLimitedLinkedBlockingQueue extends LinkedBlockingQueue {
-
- private static final long serialVersionUID = -6106022470621447542L;
-
- private final MemoryLimiter memoryLimiter;
-
- public MemoryLimitedLinkedBlockingQueue(final Instrumentation inst) {
- this(Integer.MAX_VALUE, inst);
- }
-
- public MemoryLimitedLinkedBlockingQueue(final long memoryLimit,
- final Instrumentation inst) {
- super(Integer.MAX_VALUE);
- this.memoryLimiter = new MemoryLimiter(memoryLimit, inst);
- }
-
- public MemoryLimitedLinkedBlockingQueue(final Collection extends E> c,
- final long memoryLimit,
- final Instrumentation inst) {
- super(c);
- this.memoryLimiter = new MemoryLimiter(memoryLimit, inst);
- }
-
- /**
- * set the memory limit.
- *
- * @param memoryLimit the memory limit
- */
- public void setMemoryLimit(final long memoryLimit) {
- memoryLimiter.setMemoryLimit(memoryLimit);
- }
-
- /**
- * get the memory limit.
- *
- * @return the memory limit
- */
- public long getMemoryLimit() {
- return memoryLimiter.getMemoryLimit();
- }
-
- /**
- * get the current memory.
- *
- * @return the current memory
- */
- public long getCurrentMemory() {
- return memoryLimiter.getCurrentMemory();
- }
-
- /**
- * get the current remain memory.
- *
- * @return the current remain memory
- */
- public long getCurrentRemainMemory() {
- return memoryLimiter.getCurrentRemainMemory();
- }
-
- @Override
- public void put(final E e) throws InterruptedException {
- memoryLimiter.acquireInterruptibly(e);
- super.put(e);
- }
-
- @Override
- public boolean offer(final E e, final long timeout, final TimeUnit unit) throws InterruptedException {
- return memoryLimiter.acquire(e, timeout, unit) && super.offer(e, timeout, unit);
- }
-
- @Override
- public boolean offer(final E e) {
- return memoryLimiter.acquire(e) && super.offer(e);
- }
-
- @Override
- public E take() throws InterruptedException {
- final E e = super.take();
- memoryLimiter.releaseInterruptibly(e);
- return e;
- }
-
- @Override
- public E poll(final long timeout, final TimeUnit unit) throws InterruptedException {
- final E e = super.poll(timeout, unit);
- memoryLimiter.releaseInterruptibly(e, timeout, unit);
- return e;
- }
-
- @Override
- public E poll() {
- final E e = super.poll();
- memoryLimiter.release(e);
- return e;
- }
-
- @Override
- public boolean remove(final Object o) {
- final boolean success = super.remove(o);
- if (success) {
- memoryLimiter.release(o);
- }
- return success;
- }
-
- @Override
- public void clear() {
- super.clear();
- memoryLimiter.reset();
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimitedTaskQueue.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimitedTaskQueue.java
deleted file mode 100644
index 5df59eb..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimitedTaskQueue.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.lang.instrument.Instrumentation;
-
-/**
- * MemoryLimitedTaskQueue in the {@link org.apache.shenyu.common.concurrent.ShenyuThreadPoolExecutor}.
- * It offer a task if the executor's submittedTaskCount less than currentPoolThreadSize
- * or the currentPoolThreadSize more than executor's maximumPoolSize.
- * That can make the executor create new worker
- * when the task num is bigger than corePoolSize but less than maximumPoolSize.
- */
-public class MemoryLimitedTaskQueue extends MemoryLimitedLinkedBlockingQueue implements TaskQueue {
-
- private static final long serialVersionUID = -2635853580887179627L;
-
- private EagerExecutorService executor;
-
- public MemoryLimitedTaskQueue(final Instrumentation inst) {
- super(inst);
- }
-
- public MemoryLimitedTaskQueue(final long memoryLimit, final Instrumentation inst) {
- super(memoryLimit, inst);
- }
-
- @Override
- public EagerExecutorService getExecutor() {
- return executor;
- }
-
- @Override
- public void setExecutor(final EagerExecutorService executor) {
- this.executor = executor;
- }
-
- @Override
- public boolean doOffer(final Runnable runnable) {
- return super.offer(runnable);
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimiter.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimiter.java
deleted file mode 100644
index d771ef2..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemoryLimiter.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.lang.instrument.Instrumentation;
-import java.util.Objects;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.LongAdder;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.ReentrantLock;
-
-/**
- * memory limiter.
- *
- * @see org.apache.shenyu.common.concurrent.MemoryLimitCalculator
- */
-public class MemoryLimiter {
-
- private final Instrumentation inst;
-
- private long memoryLimit;
-
- private final LongAdder memory = new LongAdder();
-
- private final ReentrantLock acquireLock = new ReentrantLock();
-
- private final Condition notLimited = acquireLock.newCondition();
-
- private final ReentrantLock releaseLock = new ReentrantLock();
-
- private final Condition notEmpty = releaseLock.newCondition();
-
- public MemoryLimiter(final Instrumentation inst) {
- this(Integer.MAX_VALUE, inst);
- }
-
- public MemoryLimiter(final long memoryLimit, final Instrumentation inst) {
- if (memoryLimit <= 0) {
- throw new IllegalArgumentException();
- }
- this.memoryLimit = memoryLimit;
- this.inst = inst;
- }
-
- /**
- * set the memory limit.
- *
- * @param memoryLimit the memory limit
- */
- public void setMemoryLimit(final long memoryLimit) {
- if (memoryLimit <= 0) {
- throw new IllegalArgumentException();
- }
- this.memoryLimit = memoryLimit;
- }
-
- /**
- * get the memory limit.
- *
- * @return the memory limit
- */
- public long getMemoryLimit() {
- return memoryLimit;
- }
-
- /**
- * get the current memory.
- *
- * @return the current memory
- */
- public long getCurrentMemory() {
- return memory.sum();
- }
-
- /**
- * get the current remain memory.
- *
- * @return the current remain memory
- */
- public long getCurrentRemainMemory() {
- return getMemoryLimit() - getCurrentMemory();
- }
-
- private void signalNotEmpty() {
- releaseLock.lock();
- try {
- notEmpty.signal();
- } finally {
- releaseLock.unlock();
- }
- }
-
- private void signalNotLimited() {
- acquireLock.lock();
- try {
- notLimited.signal();
- } finally {
- acquireLock.unlock();
- }
- }
-
- /**
- * Locks to prevent both acquires and releases.
- */
- private void fullyLock() {
- acquireLock.lock();
- releaseLock.lock();
- }
-
- /**
- * Unlocks to allow both acquires and releases.
- */
- private void fullyUnlock() {
- releaseLock.unlock();
- acquireLock.unlock();
- }
-
- /**
- * acquire memory by {@link Object}.
- * this method does not respond to interrupts.
- *
- * @param o memory size to be applied by calculating
- * @return true if acquire success
- */
- public boolean acquire(final Object o) {
- if (Objects.isNull(o)) {
- throw new NullPointerException();
- }
- if (memory.sum() >= memoryLimit) {
- return false;
- }
- acquireLock.lock();
- try {
- final long sum = memory.sum();
- final long objectSize = inst.getObjectSize(o);
- if (sum + objectSize >= memoryLimit) {
- return false;
- }
- memory.add(objectSize);
- if (memory.sum() < memoryLimit) {
- notLimited.signal();
- }
- } finally {
- acquireLock.unlock();
- }
- if (memory.sum() > 0) {
- signalNotEmpty();
- }
- return true;
- }
-
- /**
- * acquire memory by {@link Object}.
- * this method response to interrupts.
- *
- * @param o memory size to be applied by calculating
- * @param timeout max time to wait
- * @param unit time unit
- * @return true if acquire success
- * @throws InterruptedException the InterruptedException
- */
- public boolean acquire(final Object o, final long timeout,
- final TimeUnit unit) throws InterruptedException {
- if (Objects.isNull(o)) {
- throw new NullPointerException();
- }
- long nanos = unit.toNanos(timeout);
- acquireLock.lockInterruptibly();
- try {
- final long objectSize = inst.getObjectSize(o);
- while (memory.sum() + objectSize >= memoryLimit) {
- if (nanos <= 0) {
- return false;
- }
- nanos = notLimited.awaitNanos(nanos);
- }
- memory.add(objectSize);
- if (memory.sum() < memoryLimit) {
- notLimited.signal();
- }
- } finally {
- acquireLock.unlock();
- }
- if (memory.sum() > 0) {
- signalNotEmpty();
- }
- return true;
- }
-
- /**
- * acquire memory by {@link Object}.
- * this method response to interrupts.
- *
- * @param o memory size to be applied by calculating
- * @throws InterruptedException the InterruptedException
- */
- public void acquireInterruptibly(final Object o) throws InterruptedException {
- if (Objects.isNull(o)) {
- throw new NullPointerException();
- }
- acquireLock.lockInterruptibly();
- try {
- final long objectSize = inst.getObjectSize(o);
- while (memory.sum() + objectSize >= memoryLimit) {
- notLimited.await();
- }
- memory.add(objectSize);
- if (memory.sum() < memoryLimit) {
- notLimited.signal();
- }
- } finally {
- acquireLock.unlock();
- }
- if (memory.sum() > 0) {
- signalNotEmpty();
- }
- }
-
- /**
- * release memory by {@link Object}.
- * this method does not respond to interrupts.
- *
- * @param o memory size to be applied by calculating
- */
- public void release(final Object o) {
- if (Objects.isNull(o)) {
- return;
- }
- if (memory.sum() == 0) {
- return;
- }
- releaseLock.lock();
- try {
- final long objectSize = inst.getObjectSize(o);
- if (memory.sum() > 0) {
- memory.add(-objectSize);
- if (memory.sum() > 0) {
- notEmpty.signal();
- }
- }
- } finally {
- releaseLock.unlock();
- }
- if (memory.sum() < memoryLimit) {
- signalNotLimited();
- }
- }
-
- /**
- * release memory by {@link Object}.
- * this method response to interrupts.
- *
- * @param o memory size to be applied by calculating
- * @throws InterruptedException the InterruptedException
- */
- public void releaseInterruptibly(final Object o) throws InterruptedException {
- if (Objects.isNull(o)) {
- return;
- }
- releaseLock.lockInterruptibly();
- try {
- final long objectSize = inst.getObjectSize(o);
- while (memory.sum() == 0) {
- notEmpty.await();
- }
- memory.add(-objectSize);
- if (memory.sum() > 0) {
- notEmpty.signal();
- }
- } finally {
- releaseLock.unlock();
- }
- if (memory.sum() < memoryLimit) {
- signalNotLimited();
- }
- }
-
- /**
- * release memory by {@link Object}.
- * this method response to interrupts.
- *
- * @param o memory size to be applied by calculating
- * @param timeout max time to wait
- * @param unit time unit
- * @throws InterruptedException the InterruptedException
- */
- public void releaseInterruptibly(final Object o, final long timeout,
- final TimeUnit unit) throws InterruptedException {
- if (Objects.isNull(o)) {
- return;
- }
- long nanos = unit.toNanos(timeout);
- releaseLock.lockInterruptibly();
- try {
- final long objectSize = inst.getObjectSize(o);
- while (memory.sum() == 0) {
- if (nanos <= 0) {
- return;
- }
- nanos = notEmpty.awaitNanos(nanos);
- }
- memory.add(-objectSize);
- if (memory.sum() > 0) {
- notEmpty.signal();
- }
- } finally {
- releaseLock.unlock();
- }
- if (memory.sum() < memoryLimit) {
- signalNotLimited();
- }
- }
-
- /**
- * reset this MemoryLimiter.
- */
- public void reset() {
- fullyLock();
- try {
- if (memory.sumThenReset() < memoryLimit) {
- notLimited.signal();
- }
- } finally {
- fullyUnlock();
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemorySafeLinkedBlockingQueue.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemorySafeLinkedBlockingQueue.java
deleted file mode 100644
index 6eff9a4..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemorySafeLinkedBlockingQueue.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.util.Collection;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Can completely solve the OOM problem caused by {@link java.util.concurrent.LinkedBlockingQueue},
- * does not depend on {@link java.lang.instrument.Instrumentation} and is easier to use than
- * {@link org.apache.shenyu.common.concurrent.MemoryLimitedLinkedBlockingQueue}.
- */
-public class MemorySafeLinkedBlockingQueue extends LinkedBlockingQueue {
-
- private static final long serialVersionUID = 8032578371749960142L;
-
- private int maxFreeMemory;
-
- private Rejector rejector;
-
- public MemorySafeLinkedBlockingQueue(final int maxFreeMemory) {
- super(Integer.MAX_VALUE);
- this.maxFreeMemory = maxFreeMemory;
- //default as DiscardPolicy to ensure compatibility with the old version
- this.rejector = new DiscardPolicy<>();
- }
-
- public MemorySafeLinkedBlockingQueue(final Collection extends E> c,
- final int maxFreeMemory) {
- super(c);
- this.maxFreeMemory = maxFreeMemory;
- //default as DiscardPolicy to ensure compatibility with the old version
- this.rejector = new DiscardPolicy<>();
- }
-
- /**
- * set the max free memory.
- *
- * @param maxFreeMemory the max free memory
- */
- public void setMaxFreeMemory(final int maxFreeMemory) {
- this.maxFreeMemory = maxFreeMemory;
- }
-
- /**
- * get the max free memory.
- *
- * @return the max free memory limit
- */
- public int getMaxFreeMemory() {
- return maxFreeMemory;
- }
-
- /**
- * set the rejector.
- *
- * @param rejector the rejector
- */
- public void setRejector(final Rejector rejector) {
- this.rejector = rejector;
- }
-
- /**
- * determine if there is any remaining free memory.
- *
- * @return true if has free memory
- */
- public boolean hasRemainedMemory() {
- return MemoryLimitCalculator.maxAvailable() > maxFreeMemory;
- }
-
- @Override
- public void put(final E e) throws InterruptedException {
- if (hasRemainedMemory()) {
- super.put(e);
- }
- rejector.reject(e, this);
- }
-
- @Override
- public boolean offer(final E e, final long timeout, final TimeUnit unit) throws InterruptedException {
- if (!hasRemainedMemory()) {
- rejector.reject(e, this);
- return false;
- }
- return super.offer(e, timeout, unit);
- }
-
- @Override
- public boolean offer(final E e) {
- if (!hasRemainedMemory()) {
- rejector.reject(e, this);
- return false;
- }
- return super.offer(e);
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemorySafeTaskQueue.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemorySafeTaskQueue.java
deleted file mode 100644
index dca0ccf..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/MemorySafeTaskQueue.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.util.Collection;
-
-/**
- * MemorySafeTaskQueue in the {@link org.apache.shenyu.common.concurrent.ShenyuThreadPoolExecutor}.
- * It offer a task if the executor's submittedTaskCount less than currentPoolThreadSize
- * or the currentPoolThreadSize more than executor's maximumPoolSize.
- * That can make the executor create new worker
- * when the task num is bigger than corePoolSize but less than maximumPoolSize.
- */
-public class MemorySafeTaskQueue extends MemorySafeLinkedBlockingQueue implements TaskQueue {
-
- private static final long serialVersionUID = -1998413481091670338L;
-
- private EagerExecutorService executor;
-
- public MemorySafeTaskQueue(final int maxFreeMemory) {
- super(maxFreeMemory);
- }
-
- public MemorySafeTaskQueue(final Collection extends Runnable> c, final int maxFreeMemory) {
- super(c, maxFreeMemory);
- }
-
- @Override
- public EagerExecutorService getExecutor() {
- return this.executor;
- }
-
- @Override
- public void setExecutor(final EagerExecutorService executor) {
- this.executor = executor;
- }
-
- @Override
- public boolean doOffer(final Runnable runnable) {
- return super.offer(runnable);
- }
-
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/RejectException.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/RejectException.java
deleted file mode 100644
index 8378faf..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/RejectException.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-/**
- * Exception thrown by an {@link MemorySafeLinkedBlockingQueue}
- * when a element cannot be accepted.
- */
-public class RejectException extends RuntimeException {
-
- private static final long serialVersionUID = -3240015871717170195L;
-
- /**
- * Constructs a {@code RejectException} with no detail message.
- * The cause is not initialized, and may subsequently be
- * initialized by a call to {@link #initCause(Throwable) initCause}.
- */
- public RejectException() {
- }
-
- /**
- * Constructs a {@code RejectException} with the
- * specified detail message. The cause is not initialized, and may
- * subsequently be initialized by a call to {@link
- * #initCause(Throwable) initCause}.
- *
- * @param message the detail message
- */
- public RejectException(final String message) {
- super(message);
- }
-
- /**
- * Constructs a {@code RejectException} with the
- * specified detail message and cause.
- *
- * @param message the detail message
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method)
- */
- public RejectException(final String message, final Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Constructs a {@code RejectException} with the
- * specified cause. The detail message is set to {@code (cause ==
- * null ? null : cause.toString())} (which typically contains
- * the class and detail message of {@code cause}).
- *
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method)
- */
- public RejectException(final Throwable cause) {
- super(cause);
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/Rejector.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/Rejector.java
deleted file mode 100644
index 3865498..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/Rejector.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.util.Queue;
-
-/**
- * RejectHandler, it works when you need to custom reject action in
- * {@link org.apache.shenyu.common.concurrent.MemorySafeLinkedBlockingQueue}.
- *
- * @see AbortPolicy
- * @see DiscardPolicy
- * @see DiscardOldestPolicy
- */
-public interface Rejector {
-
- /**
- * Method that may be invoked by a {@link MemorySafeLinkedBlockingQueue} when
- * {@link MemorySafeLinkedBlockingQueue#hasRemainedMemory} return true.
- * This may occur when no more memory are available because their bounds would be exceeded.
- *
- * In the absence of other alternatives, the method may throw an unchecked
- * {@link RejectException}, which will be propagated to the caller.
- *
- * @param e the element requested to be added
- * @param queue the queue attempting to add this element
- * @throws RejectException if there is no more memory
- */
- void reject(E e, Queue queue);
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/ShenyuThreadPoolExecutor.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/ShenyuThreadPoolExecutor.java
deleted file mode 100644
index fdaa1fa..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/ShenyuThreadPoolExecutor.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.util.Objects;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.RejectedExecutionHandler;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-/**
- * ShenyuThreadPoolExecutor.
- */
-public class ShenyuThreadPoolExecutor extends ThreadPoolExecutor implements EagerExecutorService {
-
- public ShenyuThreadPoolExecutor(final int corePoolSize,
- final int maximumPoolSize,
- final long keepAliveTime,
- final TimeUnit unit,
- final TaskQueue workQueue,
- final ThreadFactory threadFactory,
- final RejectedExecutionHandler handler) {
- super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler);
- workQueue.setExecutor(this);
- }
-
- @Override
- public void execute(final Runnable command) {
- if (Objects.isNull(command)) {
- throw new NullPointerException();
- }
-
- try {
- super.execute(command);
- } catch (RejectedExecutionException e) {
- // retry to offer the task into queue.
- final TaskQueue queue = (TaskQueue) super.getQueue();
- try {
- if (!queue.retryOffer(command, 0, TimeUnit.MILLISECONDS)) {
- throw new RejectedExecutionException("Queue capacity is full.", e);
- }
- } catch (InterruptedException t) {
- throw new RejectedExecutionException(t);
- }
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/TaskQueue.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/TaskQueue.java
deleted file mode 100644
index d1f16bf..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/concurrent/TaskQueue.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.concurrent;
-
-import java.util.Objects;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.TimeUnit;
-
-/**
- * TaskQueue.
- */
-public interface TaskQueue extends BlockingQueue {
-
- /**
- * get executor.
- *
- * @return the executor
- */
- EagerExecutorService getExecutor();
-
- /**
- * set the executor.
- *
- * @param executor executor
- */
- void setExecutor(EagerExecutorService executor);
-
- @Override
- default boolean offer(final E e) {
- if (Objects.isNull(getExecutor())) {
- throw new RejectedExecutionException("The task queue does not have executor!");
- }
-
- int currentPoolThreadSize = getExecutor().getPoolSize();
- // have free worker. put task into queue to let the worker deal with task.
- if (getExecutor().getActiveCount() < currentPoolThreadSize) {
- return doOffer(e);
- }
-
- // return false to let executor create new worker.
- if (currentPoolThreadSize < getExecutor().getMaximumPoolSize()) {
- return false;
- }
-
- // currentPoolThreadSize >= max
- return doOffer(e);
- }
-
- /**
- * offer element to the queue.
- *
- * @param e the element to add
- * @return {@code true} if the element was added to this queue, else {@code false}
- */
- boolean doOffer(E e);
-
- /**
- * retry offer task.
- *
- * @param o task
- * @param timeout timeout
- * @param unit timeout unit
- * @return offer success or not
- * @throws java.util.concurrent.RejectedExecutionException if executor is terminated.
- * @throws java.lang.InterruptedException if the current thread is interrupted.
- */
- default boolean retryOffer(final E o, final long timeout, final TimeUnit unit) throws InterruptedException {
- if (getExecutor().isShutdown()) {
- throw new RejectedExecutionException("Executor is shutdown!");
- }
- return offer(o, timeout, unit);
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/NettyChannelProperties.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/NettyChannelProperties.java
deleted file mode 100644
index e3dfd7c..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/NettyChannelProperties.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.config;
-
-import io.netty.buffer.ByteBufAllocator;
-import io.netty.buffer.PooledByteBufAllocator;
-import io.netty.buffer.UnpooledByteBufAllocator;
-import io.netty.channel.DefaultMessageSizeEstimator;
-import io.netty.channel.MessageSizeEstimator;
-
-import java.util.Objects;
-
-/**
- * Netty channel properties.
- */
-public class NettyChannelProperties {
-
- private static final String UN_POOLED = "unpooled";
-
- private static final String POOLED = "pooled";
-
- private Integer connectTimeoutMillis = 10000;
-
- private Integer writeBufferHighWaterMark = 65536;
-
- private Integer writeBufferLowWaterMark = 32768;
-
- private Integer writeSpinCount = 16;
-
- private Boolean autoRead = false;
-
- /**
- * options: unpooled or pooled.
- */
- private String allocType = POOLED;
-
- private Boolean soReuseAddr = false;
-
- /**
- * message estimator.
- */
- private Integer messageSizeEstimator = 8;
-
- /**
- * single event executor.
- */
- private Boolean singleEventExecutorPerGroup = true;
-
- /**
- * get connectTimeoutMillis.
- *
- * @return connectTimeoutMillis
- */
- public Integer getConnectTimeoutMillis() {
- return connectTimeoutMillis;
- }
-
- /**
- * set connectTimeoutMillis.
- *
- * @param connectTimeoutMillis the connection timeout millis
- */
- public void setConnectTimeoutMillis(final Integer connectTimeoutMillis) {
- this.connectTimeoutMillis = connectTimeoutMillis;
- }
-
- /**
- * get writeBufferHighWaterMark.
- *
- * @return writeBufferHighWaterMark
- */
- public Integer getWriteBufferHighWaterMark() {
- return writeBufferHighWaterMark;
- }
-
- /**
- * set writeBufferHighWaterMark.
- *
- * @param writeBufferHighWaterMark write buffer high water mark
- */
- public void setWriteBufferHighWaterMark(final Integer writeBufferHighWaterMark) {
- this.writeBufferHighWaterMark = writeBufferHighWaterMark;
- }
-
- /**
- * get writeBufferLowWaterMark.
- *
- * @return writeBufferLowWaterMark
- */
- public Integer getWriteBufferLowWaterMark() {
- return writeBufferLowWaterMark;
- }
-
- /**
- * set writeBufferLowWaterMark.
- *
- * @param writeBufferLowWaterMark write buffer low water mark
- */
- public void setWriteBufferLowWaterMark(final Integer writeBufferLowWaterMark) {
- this.writeBufferLowWaterMark = writeBufferLowWaterMark;
- }
-
- /**
- * get writeSpinCount.
- *
- * @return writeSpinCount
- */
- public Integer getWriteSpinCount() {
- return writeSpinCount;
- }
-
- /**
- * set writeSpinCount.
- *
- * @param writeSpinCount WRITE_SPIN_COUNT
- */
- public void setWriteSpinCount(final Integer writeSpinCount) {
- this.writeSpinCount = writeSpinCount;
- }
-
- /**
- * get autoRead.
- *
- * @return autoRead
- */
- public Boolean isAutoRead() {
- return autoRead;
- }
-
- /**
- * set autoRead.
- *
- * @param autoRead AUTO_READ
- */
- public void setAutoRead(final Boolean autoRead) {
- this.autoRead = autoRead;
- }
-
- /**
- * get allocator.
- *
- * @return ByteBufAllocator
- */
- public ByteBufAllocator getAllocator() {
- return UN_POOLED.equals(getAllocType()) ? UnpooledByteBufAllocator.DEFAULT : PooledByteBufAllocator.DEFAULT;
- }
-
- /**
- * get allocator type.
- *
- * @return allocator type
- */
- public String getAllocType() {
- return allocType;
- }
-
- /**
- * set allocator type.
- *
- * @param allocType allocator type
- */
- public void setAllocType(final String allocType) {
- this.allocType = allocType;
- }
-
- /**
- * get SoReuseaddr.
- *
- * @return soReuseAddr
- */
- public Boolean isSoReuseAddr() {
- return soReuseAddr;
- }
-
- /**
- * set setSoReuseAddr.
- *
- * @param soReuseAddr SO_REUSEADDR
- */
- public void setSoReuseAddr(final Boolean soReuseAddr) {
- this.soReuseAddr = soReuseAddr;
- }
-
- /**
- * message size estimator.
- *
- * @return MessageSizeEstimator
- */
- public MessageSizeEstimator getMessageSizeEstimatorBuild() {
- return Objects.isNull(messageSizeEstimator) || messageSizeEstimator == 8 ? DefaultMessageSizeEstimator.DEFAULT
- : new DefaultMessageSizeEstimator(this.getMessageSizeEstimator());
- }
-
- /**
- * get message size estimator.
- *
- * @return message size estimator
- */
- public Integer getMessageSizeEstimator() {
- return messageSizeEstimator;
- }
-
- /**
- * set message size estimator.
- *
- * @param messageSizeEstimator messageSizeEstimator
- */
- public void setMessageSizeEstimator(final Integer messageSizeEstimator) {
- this.messageSizeEstimator = messageSizeEstimator;
- }
-
- /**
- * single event executor.
- *
- * @return single event executor state
- */
- public Boolean getSingleEventExecutorPerGroup() {
- return singleEventExecutorPerGroup;
- }
-
- /**
- * set single event executor.
- *
- * @param singleEventExecutorPerGroup single executor
- */
- public void setSingleEventExecutorPerGroup(final Boolean singleEventExecutorPerGroup) {
- this.singleEventExecutorPerGroup = singleEventExecutorPerGroup;
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/NettyHttpProperties.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/NettyHttpProperties.java
deleted file mode 100644
index 82c8949..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/NettyHttpProperties.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.config;
-
-import org.apache.shenyu.common.config.ssl.SslCrtAndKeyFile;
-
-import java.util.List;
-
-/**
- * The netty tcp properties.
- */
-public class NettyHttpProperties {
-
- private Boolean webServerFactoryEnabled = true;
-
- private Integer selectCount = 1;
-
- private Integer workerCount = Runtime.getRuntime().availableProcessors() << 1;
-
- private Boolean accessLog = false;
-
- private ServerSocketChannelProperties serverSocketChannel = new ServerSocketChannelProperties();
-
- private SocketChannelProperties socketChannel = new SocketChannelProperties();
-
- private SniProperties sni = new SniProperties();
-
- /**
- * get webServerFactoryEnabled.
- *
- * @return webServerFactoryEnabled
- */
- public Boolean isWebServerFactoryEnabled() {
- return webServerFactoryEnabled;
- }
-
- /**
- * set webServerFactoryEnabled.
- * set to false, user can custom the netty tcp server config.
- *
- * @param webServerFactoryEnabled web server factory enabled
- */
- public void setWebServerFactoryEnabled(final Boolean webServerFactoryEnabled) {
- this.webServerFactoryEnabled = webServerFactoryEnabled;
- }
-
- /**
- * get select count.
- *
- * @return selectCount
- */
- public Integer getSelectCount() {
- return selectCount;
- }
-
- /**
- * set selectCount.
- *
- * @param selectCount select count
- */
- public void setSelectCount(final Integer selectCount) {
- this.selectCount = selectCount;
- }
-
- /**
- * get workerCount.
- *
- * @return workerCount
- */
- public Integer getWorkerCount() {
- return workerCount;
- }
-
- /**
- * set workerCount.
- *
- * @param workerCount worker count
- */
- public void setWorkerCount(final Integer workerCount) {
- this.workerCount = workerCount;
- }
-
- /**
- * get serverSocketChannel.
- *
- * @return serverSocketChannel
- */
- public ServerSocketChannelProperties getServerSocketChannel() {
- return serverSocketChannel;
- }
-
- /**
- * set serverSocketChannel.
- *
- * @param serverSocketChannel server socket channel config
- */
- public void setServerSocketChannel(final ServerSocketChannelProperties serverSocketChannel) {
- this.serverSocketChannel = serverSocketChannel;
- }
-
- /**
- * set socketChannel.
- *
- * @param socketChannel socket channel config
- */
- public void setSocketChannel(final SocketChannelProperties socketChannel) {
- this.socketChannel = socketChannel;
- }
-
- /**
- * get socketChannel.
- *
- * @return socketChannel
- */
- public SocketChannelProperties getSocketChannel() {
- return socketChannel;
- }
-
- /**
- * get sni properties.
- *
- * @return sni properties
- */
- public SniProperties getSni() {
- return sni;
- }
-
- /**
- * set sni properties.
- *
- * @param sni sni properties
- */
- public void setSni(final SniProperties sni) {
- this.sni = sni;
- }
-
- /**
- * get access log state.
- *
- * @return access log state
- */
- public Boolean getAccessLog() {
- return accessLog;
- }
-
- /**
- * set access log state.
- *
- * @param accessLog access log state
- */
- public void setAccessLog(final Boolean accessLog) {
- this.accessLog = accessLog;
- }
-
- public static class ServerSocketChannelProperties extends NettyChannelProperties {
-
- private Integer soBacklog = 128;
-
- /**
- * get soBacklog.
- *
- * @return soBacklog
- */
- public Integer getSoBacklog() {
- return soBacklog;
- }
-
- /**
- * set soBacklog.
- *
- * @param soBacklog SO_BACKLOG
- */
- public void setSoBacklog(final Integer soBacklog) {
- this.soBacklog = soBacklog;
- }
- }
-
- public static class SocketChannelProperties extends NettyChannelProperties {
-
- private Boolean soKeepAlive = false;
-
- private Integer soLinger = -1;
-
- private Boolean tcpNoDelay = true;
-
- private Integer ipTos = 0;
-
- private Boolean allowHalfClosure = false;
-
- /**
- * get soKeepAlive.
- *
- * @return soKeepAlive
- */
- public Boolean isSoKeepAlive() {
- return soKeepAlive;
- }
-
- /**
- * set soKeepAlive.
- *
- * @param soKeepAlive SO_KEEPALIVE
- */
- public void setSoKeepAlive(final Boolean soKeepAlive) {
- this.soKeepAlive = soKeepAlive;
- }
-
- /**
- * get soLinger.
- *
- * @return soLinger
- */
- public Integer getSoLinger() {
- return soLinger;
- }
-
- /**
- * set soLinger.
- *
- * @param soLinger SO_LINGER
- */
- public void setSoLinger(final Integer soLinger) {
- this.soLinger = soLinger;
- }
-
- /**
- * get tcpNoDelay.
- *
- * @return tcpNoDelay
- */
- public Boolean isTcpNoDelay() {
- return tcpNoDelay;
- }
-
- /**
- * set tcpNoDelay.
- *
- * @param tcpNoDelay TCP_NODELAY
- */
- public void setTcpNoDelay(final Boolean tcpNoDelay) {
- this.tcpNoDelay = tcpNoDelay;
- }
-
- /**
- * get ipTos.
- * @return ipTos
- */
- public Integer getIpTos() {
- return ipTos;
- }
-
- /**
- * set ipTos.
- *
- * @param ipTos IP_TOS
- */
- public void setIpTos(final Integer ipTos) {
- this.ipTos = ipTos;
- }
-
- /**
- * get isAllowHalfClosure.
- *
- * @return isAllowHalfClosure
- */
- public Boolean isAllowHalfClosure() {
- return allowHalfClosure;
- }
-
- /**
- * set allowHalfClosure.
- *
- * @param allowHalfClosure ALLOW_HALF_CLOSURE
- */
- public void setAllowHalfClosure(final Boolean allowHalfClosure) {
- this.allowHalfClosure = allowHalfClosure;
- }
- }
-
- public static class SniProperties {
-
- private Boolean enabled = false;
-
- private String mod;
-
- private String defaultK8sSecretName;
-
- private String defaultK8sSecretNamespace;
-
- private List certificates;
-
- /**
- * Get default kubernetes secret namespace.
- *
- * @return default kubernetes secret namespace
- */
- public String getDefaultK8sSecretNamespace() {
- return defaultK8sSecretNamespace;
- }
-
- /**
- * Set default kubernetes secret namespace.
- *
- * @param defaultK8sSecretNamespace default kubernetes secret namespace
- */
- public void setDefaultK8sSecretNamespace(final String defaultK8sSecretNamespace) {
- this.defaultK8sSecretNamespace = defaultK8sSecretNamespace;
- }
-
- /**
- * get enabled.
- * @return enabled
- */
- public Boolean getEnabled() {
- return enabled;
- }
-
- /**
- * set enabled.
- * @param enabled enabled
- */
- public void setEnabled(final Boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * get mod.
- * @return mod
- */
- public String getMod() {
- return mod;
- }
-
- /**
- * set mod.
- * @param mod mod
- */
- public void setMod(final String mod) {
- this.mod = mod;
- }
-
- /**
- * get defaultK8sSecretName.
- * @return defaultK8sSecretName
- */
- public String getDefaultK8sSecretName() {
- return defaultK8sSecretName;
- }
-
- /**
- * set defaultK8sSecretName.
- * @param defaultK8sSecretName defaultK8sSecretName
- */
- public void setDefaultK8sSecretName(final String defaultK8sSecretName) {
- this.defaultK8sSecretName = defaultK8sSecretName;
- }
-
- /**
- * get certificates.
- * @return certificates
- */
- public List getCertificates() {
- return certificates;
- }
-
- /**
- * set certificates.
- * @param certificates certificates
- */
- public void setCertificates(final List certificates) {
- this.certificates = certificates;
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java
deleted file mode 100644
index 8b181bf..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java
+++ /dev/null
@@ -1,2018 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.config;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.shenyu.common.concurrent.MemoryLimitCalculator;
-import org.apache.shenyu.common.enums.TrieMatchModeEnum;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-/**
- * The type shenyu config.
- */
-public class ShenyuConfig {
-
- private SwitchConfig switchConfig = new SwitchConfig();
-
- private FileConfig file = new FileConfig();
-
- private ExcludePath exclude = new ExcludePath();
-
- private Health health = new Health();
-
- private FallbackPath fallback = new FallbackPath();
-
- private ExtPlugin extPlugin = new ExtPlugin();
-
- private Scheduler scheduler = new Scheduler();
-
- private UpstreamCheck upstreamCheck = new UpstreamCheck();
-
- private CrossFilterConfig cross = new CrossFilterConfig();
-
- private RibbonConfig ribbon = new RibbonConfig();
-
- private Local local = new Local();
-
- private WebsocketConfig websocket = new WebsocketConfig();
-
- private SharedPool sharedPool = new SharedPool();
-
- private MetricsConfig metrics = new MetricsConfig();
-
- private SelectorMatchCache selectorMatchCache = new SelectorMatchCache();
-
- private RuleMatchCache ruleMatchCache = new RuleMatchCache();
-
- private SpringCloudCacheConfig springCloudCache = new SpringCloudCacheConfig();
-
- private AlertConfig alert = new AlertConfig();
-
- /**
- * Gets health.
- *
- * @return the health
- */
- public Health getHealth() {
- return health;
- }
-
- /**
- * Sets health.
- *
- * @param health the health
- */
- public void setHealth(final Health health) {
- this.health = health;
- }
-
- /**
- * Gets metrics.
- *
- * @return the metrics
- */
- public MetricsConfig getMetrics() {
- return metrics;
- }
-
- /**
- * Sets metrics.
- *
- * @param metrics the metrics
- */
- public void setMetrics(final MetricsConfig metrics) {
- this.metrics = metrics;
- }
-
- /**
- * Gets the shared thread pool config.
- *
- * @return the shared thread pool config
- */
- public SharedPool getSharedPool() {
- return sharedPool;
- }
-
- /**
- * Sets the shared thread pool config.
- *
- * @param sharedPool the shared thread pool config
- */
- public void setSharedPool(final SharedPool sharedPool) {
- this.sharedPool = sharedPool;
- }
-
- /**
- * Gets the local config.
- *
- * @return the local config
- */
- public Local getLocal() {
- return local;
- }
-
- /**
- * Sets the local config.
- *
- * @param local the local config
- */
- public void setLocal(final Local local) {
- this.local = local;
- }
-
- /**
- * Gets ribbon.
- *
- * @return the ribbon
- */
- public RibbonConfig getRibbon() {
- return ribbon;
- }
-
- /**
- * Sets ribbon.
- *
- * @param ribbon the ribbon
- */
- public void setRibbon(final RibbonConfig ribbon) {
- this.ribbon = ribbon;
- }
-
- /**
- * Gets switch config.
- *
- * @return the switch config
- */
- public SwitchConfig getSwitchConfig() {
- return switchConfig;
- }
-
- /**
- * Sets switch config.
- *
- * @param switchConfig the switch config
- */
- public void setSwitchConfig(final SwitchConfig switchConfig) {
- this.switchConfig = switchConfig;
- }
-
- /**
- * Gets scheduler.
- *
- * @return the scheduler
- */
- public Scheduler getScheduler() {
- return scheduler;
- }
-
- /**
- * Sets scheduler.
- *
- * @param scheduler the scheduler
- */
- public void setScheduler(final Scheduler scheduler) {
- this.scheduler = scheduler;
- }
-
- /**
- * Gets ext plugin.
- *
- * @return the ext plugin
- */
- public ExtPlugin getExtPlugin() {
- return extPlugin;
- }
-
- /**
- * Sets ext plugin.
- *
- * @param extPlugin the ext plugin
- */
- public void setExtPlugin(final ExtPlugin extPlugin) {
- this.extPlugin = extPlugin;
- }
-
- /**
- * Gets file.
- *
- * @return the file
- */
- public FileConfig getFile() {
- return file;
- }
-
- /**
- * Sets file.
- *
- * @param file the file
- */
- public void setFile(final FileConfig file) {
- this.file = file;
- }
-
- /**
- * Gets exclude.
- *
- * @return the exclude
- */
- public ExcludePath getExclude() {
- return exclude;
- }
-
- /**
- * Sets exclude.
- *
- * @param exclude the exclude
- */
- public void setExclude(final ExcludePath exclude) {
- this.exclude = exclude;
- }
-
- /**
- * Gets fallback.
- *
- * @return the fallback
- */
- public FallbackPath getFallback() {
- return fallback;
- }
-
- /**
- * Sets fallback.
- *
- * @param fallback the fallback
- */
- public void setFallback(final FallbackPath fallback) {
- this.fallback = fallback;
- }
-
- /**
- * Gets upstream check.
- *
- * @return the upstream check
- */
- public UpstreamCheck getUpstreamCheck() {
- return upstreamCheck;
- }
-
- /**
- * Sets upstream check.
- *
- * @param upstreamCheck the upstream check
- */
- public void setUpstreamCheck(final UpstreamCheck upstreamCheck) {
- this.upstreamCheck = upstreamCheck;
- }
-
- /**
- * Gets cross.
- *
- * @return the cross
- */
- public CrossFilterConfig getCross() {
- return cross;
- }
-
- /**
- * Gets the websocket config.
- *
- * @return the websocket config
- */
- public WebsocketConfig getWebsocket() {
- return websocket;
- }
-
- /**
- * Sets the websocket config.
- *
- * @param websocket the websocket config
- */
- public void setWebsocket(final WebsocketConfig websocket) {
- this.websocket = websocket;
- }
-
- /**
- * Sets cross.
- *
- * @param cross the cross
- */
- public void setCross(final CrossFilterConfig cross) {
- this.cross = cross;
- }
-
- /**
- * get selector match cache.
- *
- * @return selector match cache
- */
- public SelectorMatchCache getSelectorMatchCache() {
- return selectorMatchCache;
- }
-
- /**
- * set selector match cache.
- *
- * @param selectorMatchCache selector match cache
- */
- public void setSelectorMatchCache(final SelectorMatchCache selectorMatchCache) {
- this.selectorMatchCache = selectorMatchCache;
- }
-
- /**
- * get rule match cache.
- *
- * @return rule match cache
- */
- public RuleMatchCache getRuleMatchCache() {
- return ruleMatchCache;
- }
-
- /**
- * set rule match cache.
- *
- * @param ruleMatchCache rule match cache
- */
- public void setRuleMatchCache(final RuleMatchCache ruleMatchCache) {
- this.ruleMatchCache = ruleMatchCache;
- }
-
- /**
- * get spring cloud cache config.
- *
- * @return {@linkplain SpringCloudCacheConfig}
- */
- public SpringCloudCacheConfig getSpringCloudCache() {
- return springCloudCache;
- }
-
- /**
- * set spring cloud cache config.
- *
- * @param springCloudCache cache config
- */
- public void setSpringCloudCache(final SpringCloudCacheConfig springCloudCache) {
- this.springCloudCache = springCloudCache;
- }
-
- /**
- * Get shenyu alert report config.
- * @return alert config
- */
- public AlertConfig getAlert() {
- return alert;
- }
-
- /**
- * Set shenyu alert report config.
- * @param alert alert config
- */
- public void setAlert(final AlertConfig alert) {
- this.alert = alert;
- }
-
- /**
- * The type Scheduler.
- */
- public static class Scheduler {
-
- private boolean enabled;
-
- private String type = "fixed";
-
- private Integer threads = Math.max((Runtime.getRuntime().availableProcessors() << 1) + 1, 16);
-
- /**
- * Gets enabled.
- *
- * @return the enabled
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * Sets enabled.
- *
- * @param enabled the enabled
- */
- public void setEnabled(final boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * Gets type.
- *
- * @return the type
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets type.
- *
- * @param type the type
- */
- public void setType(final String type) {
- this.type = type;
- }
-
- /**
- * Gets threads.
- *
- * @return the threads
- */
- public Integer getThreads() {
- return threads;
- }
-
- /**
- * Sets threads.
- *
- * @param threads the threads
- */
- public void setThreads(final Integer threads) {
- this.threads = threads;
- }
-
- }
-
- /**
- * The type Ext plugin.
- */
- public static class ExtPlugin {
-
- private String path;
-
- private boolean enabled;
-
- private Integer threads = 1;
-
- private Integer scheduleTime = 300;
-
- private Integer scheduleDelay = 30;
-
- /**
- * Gets path.
- *
- * @return the path
- */
- public String getPath() {
- return path;
- }
-
- /**
- * Sets path.
- *
- * @param path the path
- */
- public void setPath(final String path) {
- this.path = path;
- }
-
- /**
- * Gets enabled.
- *
- * @return the enabled
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * Sets enabled.
- *
- * @param enabled the enabled
- */
- public void setEnabled(final boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * Gets threads.
- *
- * @return the threads
- */
- public Integer getThreads() {
- return threads;
- }
-
- /**
- * Sets threads.
- *
- * @param threads the threads
- */
- public void setThreads(final Integer threads) {
- this.threads = threads;
- }
-
- /**
- * Gets schedule time.
- *
- * @return the schedule time
- */
- public Integer getScheduleTime() {
- return scheduleTime;
- }
-
- /**
- * Sets schedule time.
- *
- * @param scheduleTime the schedule time
- */
- public void setScheduleTime(final Integer scheduleTime) {
- this.scheduleTime = scheduleTime;
- }
-
- /**
- * Gets schedule delay.
- *
- * @return the schedule delay
- */
- public Integer getScheduleDelay() {
- return scheduleDelay;
- }
-
- /**
- * Sets schedule delay.
- *
- * @param scheduleDelay the schedule delay
- */
- public void setScheduleDelay(final Integer scheduleDelay) {
- this.scheduleDelay = scheduleDelay;
- }
- }
-
- public static class SelectorMatchCache {
-
- /**
- * the match cache, L1 cache.
- */
- private MatchCacheConfig cache = new MatchCacheConfig();
-
- /**
- * the trie cache, L2 cache.
- */
- private ShenyuTrieConfig trie = new ShenyuTrieConfig();
-
-/**
- * get selector cache config.
- *
- * @return {@linkplain MatchCacheConfig}
- */
- public MatchCacheConfig getCache() {
- return cache;
- }
-
- /**
- * set selector cache config.
- *
- * @param cache SelectorCacheConfig
- */
- public void setCache(final MatchCacheConfig cache) {
- this.cache = cache;
- }
-
- /**
- * get rule cache Config.
- *
- * @return rule cache config
- */
- public ShenyuTrieConfig getTrie() {
- return trie;
- }
-
- /**
- * set rule cache config.
- *
- * @param trie rule cache
- */
- public void setTrie(final ShenyuTrieConfig trie) {
- this.trie = trie;
- }
- }
-
- public static class RuleMatchCache {
-
- /**
- * the match cache, L1 cache.
- */
- private MatchCacheConfig cache = new MatchCacheConfig();
-
- /**
- * the trie cache, L2 cache.
- */
- private ShenyuTrieConfig trie = new ShenyuTrieConfig();
-
- /**
- * get selector cache config.
- *
- * @return {@linkplain MatchCacheConfig}
- */
- public MatchCacheConfig getCache() {
- return cache;
- }
-
- /**
- * set selector cache config.
- *
- * @param cache SelectorCacheConfig
- */
- public void setCache(final MatchCacheConfig cache) {
- this.cache = cache;
- }
-
- /**
- * get rule cache Config.
- *
- * @return rule cache config
- */
- public ShenyuTrieConfig getTrie() {
- return trie;
- }
-
- /**
- * set rule cache config.
- *
- * @param trie rule cache
- */
- public void setTrie(final ShenyuTrieConfig trie) {
- this.trie = trie;
- }
- }
-
- /**
- * rule cache config.
- */
- public static class MatchCacheConfig {
-
- private Boolean enabled = Boolean.TRUE;
-
- private int initialCapacity = 10000;
-
- private long maximumSize = 10000L;
-
- /**
- * get rule cache enabled.
- *
- * @return rule cache enabled
- */
- public Boolean getEnabled() {
- return enabled;
- }
-
- /**
- * set rule cache enabled.
- *
- * @param enabled rule cache enabled
- */
- public void setEnabled(final Boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * get initial capacity.
- *
- * @return initial capacity
- */
- public int getInitialCapacity() {
- return initialCapacity;
- }
-
- /**
- * set initial capacity.
- *
- * @param initialCapacity initialCapacity
- */
- public void setInitialCapacity(final int initialCapacity) {
- this.initialCapacity = initialCapacity;
- }
-
- /**
- * get maximum size.
- *
- * @return rule cache maximumSize
- */
- public long getMaximumSize() {
- return maximumSize;
- }
-
- /**
- * set rule cache maximumSize.
- *
- * @param maximumSize rule cache maximumSize
- */
- public void setMaximumSize(final long maximumSize) {
- this.maximumSize = maximumSize;
- }
- }
-
- /**
- * The type Exclude path.
- */
- public static class ExcludePath {
-
- private boolean enabled;
-
- private List paths = new ArrayList<>();
-
- /**
- * Gets enabled.
- *
- * @return the enabled
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * Sets enabled.
- *
- * @param enabled the enabled
- */
- public void setEnabled(final boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * Sets paths.
- *
- * @param paths the paths
- */
- public void setPaths(final List paths) {
- this.paths = paths;
- }
-
- /**
- * get paths.
- *
- * @return paths paths
- */
- public List getPaths() {
- return paths;
- }
- }
-
- /**
- * The type fallback path.
- */
- public static class FallbackPath {
-
- private boolean enabled;
-
- private List paths = new ArrayList<>();
-
- /**
- * Gets enabled.
- *
- * @return the enabled
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * Sets enabled.
- *
- * @param enabled the enabled
- */
- public void setEnabled(final boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * Sets paths.
- *
- * @param paths the paths
- */
- public void setPaths(final List paths) {
- this.paths = paths;
- }
-
- /**
- * get paths.
- *
- * @return paths paths
- */
- public List getPaths() {
- return paths;
- }
- }
-
- /**
- * The type Health.
- */
- public static class Health {
-
- private boolean enabled;
-
- private List paths = new ArrayList<>();
-
- /**
- * Gets enabled.
- *
- * @return the enabled
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * Sets enabled.
- *
- * @param enabled the enabled
- */
- public void setEnabled(final boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * Sets paths.
- *
- * @param paths the paths
- */
- public void setPaths(final List paths) {
- this.paths = paths;
- }
-
- /**
- * get paths.
- *
- * @return paths paths
- */
- public List getPaths() {
- return paths;
- }
- }
-
- /**
- * The type File config.
- */
- public static class FileConfig {
-
- private boolean enabled;
-
- private Integer maxSize = 10;
-
- /**
- * Gets enabled.
- *
- * @return the enabled
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * Sets enabled.
- *
- * @param enabled the enabled
- */
- public void setEnabled(final boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * Gets file max size.
- *
- * @return the file max size
- */
- public Integer getMaxSize() {
- return maxSize;
- }
-
- /**
- * Sets file max size.
- *
- * @param maxSize the file max size
- */
- public void setMaxSize(final Integer maxSize) {
- this.maxSize = maxSize;
- }
- }
-
- /**
- * The type Switch config.
- */
- public static class SwitchConfig {
-
- private boolean local = true;
-
- private boolean collapseSlashes = true;
-
- /**
- * Gets local.
- *
- * @return the local
- */
- public boolean getLocal() {
- return local;
- }
-
- /**
- * Sets local.
- *
- * @param local the local
- */
- public void setLocal(final boolean local) {
- this.local = local;
- }
-
- /**
- * get collapseSlashes.
- *
- * @return collapseSlashes
- */
- public boolean getCollapseSlashes() {
- return collapseSlashes;
- }
-
- /**
- * set collapseSlashes.
- *
- * @param collapseSlashes collapseSlashes
- */
- public void setCollapseSlashes(final boolean collapseSlashes) {
- this.collapseSlashes = collapseSlashes;
- }
- }
-
- /**
- * The type Upstream check.
- */
- public static class UpstreamCheck {
-
- private boolean enabled;
-
- private Integer poolSize = 10;
-
- private Integer timeout = 3000;
-
- private Integer healthyThreshold = 1;
-
- private Integer unhealthyThreshold = 1;
-
- private Integer interval = 5000;
-
- private boolean printEnabled;
-
- private Integer printInterval = 60000;
-
- /**
- * Gets enabled.
- *
- * @return the enabled
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * Sets enabled.
- *
- * @param enabled the enabled
- */
- public void setEnabled(final boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * get checkThreadPoolSize.
- *
- * @return checkThreadPoolSize
- */
- public Integer getPoolSize() {
- return poolSize;
- }
-
- /**
- * set checkThreadPoolSize.
- *
- * @param poolSize checkThreadPoolSize
- */
- public void setPoolSize(final Integer poolSize) {
- this.poolSize = poolSize;
- }
-
- /**
- * Gets timeout.
- *
- * @return the timeout
- */
- public Integer getTimeout() {
- return timeout;
- }
-
- /**
- * Sets timeout.
- *
- * @param timeout the timeout
- */
- public void setTimeout(final Integer timeout) {
- this.timeout = timeout;
- }
-
- /**
- * Gets healthy threshold.
- *
- * @return the healthy threshold
- */
- public Integer getHealthyThreshold() {
- return healthyThreshold;
- }
-
- /**
- * Sets healthy threshold.
- *
- * @param healthyThreshold the healthy threshold
- */
- public void setHealthyThreshold(final Integer healthyThreshold) {
- this.healthyThreshold = healthyThreshold;
- }
-
- /**
- * Gets unhealthy threshold.
- *
- * @return the unhealthy threshold
- */
- public Integer getUnhealthyThreshold() {
- return unhealthyThreshold;
- }
-
- /**
- * Sets unhealthy threshold.
- *
- * @param unhealthyThreshold the unhealthy threshold
- */
- public void setUnhealthyThreshold(final Integer unhealthyThreshold) {
- this.unhealthyThreshold = unhealthyThreshold;
- }
-
- /**
- * Gets interval.
- *
- * @return the interval
- */
- public Integer getInterval() {
- return interval;
- }
-
- /**
- * Sets interval.
- *
- * @param interval the interval
- */
- public void setInterval(final Integer interval) {
- this.interval = interval;
- }
-
- /**
- * Gets print enabled.
- *
- * @return the print enabled
- */
- public boolean getPrintEnabled() {
- return printEnabled;
- }
-
- /**
- * Sets print enabled.
- *
- * @param printEnabled the print enabled
- */
- public void setPrintEnabled(final boolean printEnabled) {
- this.printEnabled = printEnabled;
- }
-
- /**
- * Gets print interval.
- *
- * @return the print interval
- */
- public Integer getPrintInterval() {
- return printInterval;
- }
-
- /**
- * Sets print interval.
- *
- * @param printInterval the print interval
- */
- public void setPrintInterval(final Integer printInterval) {
- this.printInterval = printInterval;
- }
- }
-
- /**
- * The Cross Filter Config.
- */
- public static class CrossFilterConfig {
-
- private static final Set DEFAULT_ALLOWED_HEADERS;
-
- static {
- DEFAULT_ALLOWED_HEADERS = new HashSet() {
- {
- add("x-requested-with");
- add("authorization");
- add("Content-Type");
- add("Authorization");
- add("credential");
- add("X-XSRF-TOKEN");
- add("token");
- add("username");
- add("client");
- }
- };
- }
-
- private boolean enabled;
-
- /**
- * Comma-separated of “header”.
- */
- private String allowedHeaders = "";
-
- /**
- * Comma-separated of “method”.
- */
- private String allowedMethods = "*";
-
- private AllowedOriginConfig allowedOrigin = new AllowedOriginConfig();
-
- private boolean allowedAnyOrigin;
-
- private String allowedExpose = "";
-
- private String maxAge = "18000";
-
- private boolean allowCredentials;
-
- /**
- * wrapper the headers.
- *
- * @param headers headers
- * @return wrapped headers
- */
- private String wrapperHeaders(final String headers) {
- final Set headerSet = DEFAULT_ALLOWED_HEADERS;
- if (StringUtils.isNotEmpty(headers)) {
- headerSet.addAll(Stream.of(headers.split(",")).collect(Collectors.toSet()));
- }
- return String.join(",", headerSet);
- }
-
- /**
- * Gets enabled.
- *
- * @return the enabled
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * Sets enabled.
- *
- * @param enabled the enabled
- */
- public void setEnabled(final boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * Gets the value of allowedHeaders.
- *
- * @return the value of allowedHeaders
- */
- public String getAllowedHeaders() {
- return allowedHeaders = wrapperHeaders(allowedHeaders);
- }
-
- /**
- * Sets the allowedHeaders.
- *
- * @param allowedHeaders allowedHeaders
- */
- public void setAllowedHeaders(final String allowedHeaders) {
- this.allowedHeaders = wrapperHeaders(allowedHeaders);
- }
-
- /**
- * Gets the value of allowedMethods.
- *
- * @return the value of allowedMethods
- */
- public String getAllowedMethods() {
- return allowedMethods;
- }
-
- /**
- * Sets the allowedMethods.
- *
- * @param allowedMethods allowedMethods
- */
- public void setAllowedMethods(final String allowedMethods) {
- this.allowedMethods = allowedMethods;
- }
-
- /**
- * Gets the value of allowedOrigin.
- *
- * @return the value of allowedOrigin
- */
- public AllowedOriginConfig getAllowedOrigin() {
- return allowedOrigin;
- }
-
- /**
- * Sets the allowedOrigin.
- *
- * @param allowedOrigin allowedOrigin
- */
- public void setAllowedOrigin(final AllowedOriginConfig allowedOrigin) {
- this.allowedOrigin = allowedOrigin;
- }
-
- /**
- * Gets the value of allowedAnyOrigin.
- *
- * @return the value of allowedAnyOrigin
- */
- public boolean isAllowedAnyOrigin() {
- return allowedAnyOrigin;
- }
-
- /**
- * Sets the allowedExpose.
- *
- * @param allowedAnyOrigin allowedExpose
- */
- public void setAllowedAnyOrigin(final boolean allowedAnyOrigin) {
- this.allowedAnyOrigin = allowedAnyOrigin;
- }
-
- /**
- * Gets the value of allowedExpose.
- *
- * @return the value of allowedExpose
- */
- public String getAllowedExpose() {
- return allowedExpose;
- }
-
- /**
- * Sets the allowedExpose.
- *
- * @param allowedExpose allowedExpose
- */
- public void setAllowedExpose(final String allowedExpose) {
- this.allowedExpose = allowedExpose;
- }
-
- /**
- * Gets the value of maxAge.
- *
- * @return the value of maxAge
- */
- public String getMaxAge() {
- return maxAge;
- }
-
- /**
- * Sets the maxAge.
- *
- * @param maxAge maxAge
- */
- public void setMaxAge(final String maxAge) {
- this.maxAge = maxAge;
- }
-
- /**
- * Gets the value of allowCredentials.
- *
- * @return the value of allowCredentials
- */
- public boolean isAllowCredentials() {
- return allowCredentials;
- }
-
- /**
- * Sets the allowCredentials.
- *
- * @param allowCredentials allowCredentials
- */
- public void setAllowCredentials(final boolean allowCredentials) {
- this.allowCredentials = allowCredentials;
- }
-
- /**
- * the cors allowedOrigin config.
- */
- public static class AllowedOriginConfig {
-
- private String spacer = ".";
-
- private String domain;
-
- private Set prefixes = new HashSet<>();
-
- private Set origins;
-
- private String originRegex;
-
- /**
- * Gets the spacer.
- *
- * @return the value of spacer
- */
- public String getSpacer() {
- return spacer;
- }
-
- /**
- * Sets the spacer.
- *
- * @param spacer spacer
- */
- public void setSpacer(final String spacer) {
- this.spacer = spacer;
- }
-
- /**
- * Gets the domain.
- *
- * @return the value of domain
- */
- public String getDomain() {
- return domain;
- }
-
- /**
- * Sets the enabled.
- *
- * @param domain domain
- */
- public void setDomain(final String domain) {
- this.domain = domain;
- }
-
- /**
- * Gets the prefixes.
- *
- * @return the value of prefixes
- */
- public Set getPrefixes() {
- return prefixes;
- }
-
- /**
- * Sets the enabled.
- *
- * @param prefixes prefixes
- */
- public void setPrefixes(final Set prefixes) {
- this.prefixes = prefixes;
- }
-
- /**
- * Gets the prefixes.
- *
- * @return the value of prefixes
- */
- public Set getOrigins() {
- return origins;
- }
-
- /**
- * Sets the origins.
- *
- * @param origins origins
- */
- public void setOrigins(final Set origins) {
- this.origins = origins;
- }
-
- /**
- * Gets the originRegex.
- *
- * @return the value of originRegex
- */
- public String getOriginRegex() {
- return originRegex;
- }
-
- /**
- * Sets the originRegex.
- *
- * @param originRegex originRegex
- */
- public void setOriginRegex(final String originRegex) {
- this.originRegex = originRegex;
- }
- }
- }
-
- /**
- * The Ribbon Config.
- */
- public static class RibbonConfig {
-
- /**
- * see {@code com.netflix.client.config.CommonClientConfigKey#ServerListRefreshInterval}.
- */
- private Integer serverListRefreshInterval = 10000;
-
- /**
- * Instantiates a new RibbonConfig.
- */
- public RibbonConfig() {
- }
-
- /**
- * Instantiates a new RibbonConfig.
- *
- * @param serverListRefreshInterval serverListRefreshInterval
- */
- public RibbonConfig(final Integer serverListRefreshInterval) {
- this.serverListRefreshInterval = serverListRefreshInterval;
- }
-
- /**
- * Gets serverListRefreshInterval.
- *
- * @return the serverListRefreshInterval
- */
- public Integer getServerListRefreshInterval() {
- return serverListRefreshInterval;
- }
-
- /**
- * setServerListRefreshInterval.
- *
- * @param serverListRefreshInterval serverListRefreshInterval
- */
- public void setServerListRefreshInterval(final Integer serverListRefreshInterval) {
- this.serverListRefreshInterval = serverListRefreshInterval;
- }
- }
-
- /**
- * The local config.
- */
- public static class Local {
-
- private boolean enabled;
-
- private String sha512Key;
-
- /**
- * Instantiates a new Local.
- */
- public Local() {
- }
-
- /**
- * Instantiates a new Local.
- *
- * @param sha512Key the sha 512 key
- */
- public Local(final String sha512Key) {
- this.sha512Key = sha512Key;
- }
-
- /**
- * Gets enabled.
- *
- * @return the enabled
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * Sets enabled.
- *
- * @param enabled the enabled
- */
- public void setEnabled(final boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * Get Sha512Key.
- *
- * @return the key
- */
- public String getSha512Key() {
- return sha512Key;
- }
-
- /**
- * Set Sha512Key.
- *
- * @param sha512Key sha512Key
- */
- public void setSha512Key(final String sha512Key) {
- this.sha512Key = sha512Key;
- }
- }
-
- /**
- * the websocket config.
- */
- public static class WebsocketConfig {
-
- /**
- * max frame pay load size mb.
- */
- private Integer maxFramePayloadSize = 10;
-
- /**
- * whether enable ping.
- */
- private Boolean enableProxyPing = false;
-
- /**
- * Get max frame payload size.
- *
- * @return the max frame payload szie
- */
- public Integer getMaxFramePayloadSize() {
- return maxFramePayloadSize;
- }
-
- /**
- * Set max frame payload size.
- *
- * @param maxFramePayloadSize the max frame paylod size
- */
- public void setMaxFramePayloadSize(final Integer maxFramePayloadSize) {
- this.maxFramePayloadSize = maxFramePayloadSize;
- }
-
- /**
- * Get whether enable ping.
- * @return whether ping is enabled
- */
- public Boolean getEnableProxyPing() {
- return enableProxyPing;
- }
-
- /**
- * enable ping or disable ping.
- * @param enableProxyPing enable ping or disable ping
- */
- public void setEnableProxyPing(final boolean enableProxyPing) {
- this.enableProxyPing = enableProxyPing;
- }
- }
-
- /**
- * The type Shared Thread Pool.
- */
- public static class SharedPool {
-
- /**
- * Whether to enable shared thread pool, defaults to false.
- * Note: it is planned to be enabled by default when all RPC/HTTP
- * plugins support this shared thread pool.
- */
- private Boolean enable = Boolean.FALSE;
-
- /**
- * The the thread name prefix, defaults to shenyu-shared.
- */
- private String prefix = "shenyu-shared";
-
- /**
- * the number of threads to keep in the thread pool.
- */
- private Integer corePoolSize = 200;
-
- /**
- * the maximum number of threads to allow in the thread pool.
- */
- private Integer maximumPoolSize = Integer.MAX_VALUE;
-
- /**
- * when the number of threads is greater than the core,
- * this is the maximum time that excess idle threads
- * will wait for new tasks before terminating.
- * Note: the unit of time is {@link java.util.concurrent.TimeUnit#MILLISECONDS}
- */
- private Long keepAliveTime = 60000L;
-
- /**
- * Maximum memory allowed to be used by a blocking queue, yes, unlike other
- * implementations of {@link java.util.concurrent.BlockingQueue}
- * (which all control memory based on the length of the blocking queue),
- * {@link org.apache.shenyu.common.concurrent.MemoryLimitedLinkedBlockingQueue}
- * controls memory directly by calculating the memory size used by the blocking queue.
- */
- private Long maxWorkQueueMemory = MemoryLimitCalculator.defaultLimit();
-
- /**
- * The memory used by the blocking queue is always in the safe range, and there
- * is always an attempt to make the JVM's free memory higher than this value.
- *
- * @see org.apache.shenyu.common.concurrent.MemorySafeLinkedBlockingQueue#getMaxFreeMemory()
- */
- private Integer maxFreeMemory;
-
- /**
- * Whether to enable shared thread pool.
- *
- * @return whether to enable
- */
- public Boolean getEnable() {
- return enable;
- }
-
- /**
- * Set enable.
- *
- * @param enable the enable
- */
- public void setEnable(final Boolean enable) {
- this.enable = enable;
- }
-
- /**
- * Get shared thread pool name prefix.
- *
- * @return the shared thread pool name prefix
- */
- public String getPrefix() {
- return prefix;
- }
-
- /**
- * Set prefix.
- *
- * @param prefix the prefix
- */
- public void setPrefix(final String prefix) {
- this.prefix = prefix;
- }
-
- /**
- * Get shared thread pool core size.
- *
- * @return the shared thread pool core size
- */
- public Integer getCorePoolSize() {
- return corePoolSize;
- }
-
- /**
- * Set core pool size.
- *
- * @param corePoolSize the core pool size
- */
- public void setCorePoolSize(final Integer corePoolSize) {
- this.corePoolSize = corePoolSize;
- }
-
- /**
- * Get shared thread pool maximum size.
- *
- * @return the shared thread pool name prefix
- */
- public Integer getMaximumPoolSize() {
- return maximumPoolSize;
- }
-
- /**
- * Set max pool size.
- *
- * @param maximumPoolSize the max pool size
- */
- public void setMaximumPoolSize(final Integer maximumPoolSize) {
- this.maximumPoolSize = maximumPoolSize;
- }
-
- /**
- * Get shared thread pool keep alive time.
- *
- * @return the shared thread pool keep alive time
- */
- public Long getKeepAliveTime() {
- return keepAliveTime;
- }
-
- /**
- * Set keep alive time.
- *
- * @param keepAliveTime the keep alive time
- */
- public void setKeepAliveTime(final Long keepAliveTime) {
- this.keepAliveTime = keepAliveTime;
- }
-
- /**
- * Get shared thread pool max work queue memory.
- *
- * @return the shared thread pool max work queue memory
- */
- public Long getMaxWorkQueueMemory() {
- return maxWorkQueueMemory;
- }
-
- /**
- * Set max work queue memory.
- *
- * @param maxWorkQueueMemory the max work queue memory
- */
- public void setMaxWorkQueueMemory(final Long maxWorkQueueMemory) {
- this.maxWorkQueueMemory = maxWorkQueueMemory;
- }
-
- /**
- * Get shared thread pool max work queue free memory.
- *
- * @return the shared thread pool max work queue free memory
- */
- public Integer getMaxFreeMemory() {
- return maxFreeMemory;
- }
-
- /**
- * Set max work queue free memory.
- *
- * @param maxFreeMemory the max work queue free memory
- */
- public void setMaxFreeMemory(final Integer maxFreeMemory) {
- this.maxFreeMemory = maxFreeMemory;
- }
- }
-
- /**
- * The type Metrics config.
- */
- public static class MetricsConfig {
-
- private boolean enabled;
-
- private String name;
-
- private String host;
-
- private Integer port;
-
- private String jmxConfig;
-
- private Properties props;
-
- /**
- * Instantiates a new Metrics config.
- */
- public MetricsConfig() {
- }
-
- /**
- * Gets enabled.
- *
- * @return the enabled
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * Sets enabled.
- *
- * @param enabled the enabled
- */
- public void setEnabled(final boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * Gets metrics name.
- *
- * @return the metrics name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets metrics name.
- * @param name the metrics name
- */
- public void setName(final String name) {
- this.name = name;
- }
-
- /**
- * Gets host.
- * @return the host
- */
- public String getHost() {
- return host;
- }
-
- /**
- * Sets host.
- * @param host the host
- */
- public void setHost(final String host) {
- this.host = host;
- }
-
- /**
- * Gets port.
- * @return the port
- */
- public Integer getPort() {
- return port;
- }
-
- /**
- * Sets port.
- *
- * @param port the port
- */
- public void setPort(final Integer port) {
- this.port = port;
- }
-
- /**
- * Gets jmx config.
- * @return the jmx config
- */
- public String getJmxConfig() {
- return jmxConfig;
- }
-
- /**
- * Sets jmx config.
- * @param jmxConfig the jmx config
- */
- public void setJmxConfig(final String jmxConfig) {
- this.jmxConfig = jmxConfig;
- }
-
- /**
- * Gets props.
- * @return the props
- */
- public Properties getProps() {
- return props;
- }
-
- /**
- * Sets props.
- * @param props the props
- */
- public void setProps(final Properties props) {
- this.props = props;
- }
- }
-
- /**
- * shenyu trie config.
- */
- public static class ShenyuTrieConfig {
-
- private Boolean enabled = Boolean.FALSE;
-
- private Long cacheSize = 512L;
-
- /**
- * match mode.
- * @see TrieMatchModeEnum
- */
- private String matchMode = TrieMatchModeEnum.ANT_PATH_MATCH.getMatchMode();
-
- /**
- * get match enabled.
- * @return Boolean
- */
- public Boolean getEnabled() {
- return enabled;
- }
-
- /**
- * set match enabled.
- * @param enabled enabled
- */
- public void setEnabled(final Boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * get cache size.
- * @return cache size
- */
- public Long getCacheSize() {
- return cacheSize;
- }
-
- /**
- * set cache size.
- * @param cacheSize cache size
- */
- public void setCacheSize(final Long cacheSize) {
- this.cacheSize = cacheSize;
- }
-
- /**
- * get match mode.
- * @return match mode
- */
- public String getMatchMode() {
- return matchMode;
- }
-
- /**
- * set match mode.
- * @param matchMode match mode
- */
- public void setMatchMode(final String matchMode) {
- this.matchMode = matchMode;
- }
- }
-
- public static class SpringCloudCacheConfig {
- private Boolean enabled = Boolean.FALSE;
-
- /**
- * get shenyu spring cloud cache status.
- * @return the enabled status
- */
- public Boolean getEnabled() {
- return enabled;
- }
-
- /**
- * set shenyu spring cloud cache status.
- * @param enabled the status
- */
- public void setEnabled(final Boolean enabled) {
- this.enabled = enabled;
- }
- }
-
- public static class AlertConfig {
- private Boolean enabled = Boolean.FALSE;
-
- private String admins = "localhost:9095";
-
- /**
- * get shenyu spring cloud cache status.
- * @return the enabled status
- */
- public Boolean getEnabled() {
- return enabled;
- }
-
- /**
- * set shenyu spring cloud cache status.
- * @param enabled the status
- */
- public void setEnabled(final Boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * Get shenyu admin alert report urls.
- * eg: localhost:9095,localhost:9093
- * @return admin alert report server list
- */
- public String getAdmins() {
- return admins;
- }
-
- /**
- * Set shenyu admin alert report url.
- * @param admins admin url
- */
- public void setAdmins(final String admins) {
- this.admins = admins;
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ssl/ShenyuSniAsyncMapping.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ssl/ShenyuSniAsyncMapping.java
deleted file mode 100644
index e1e5c3d..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ssl/ShenyuSniAsyncMapping.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.config.ssl;
-
-import io.netty.util.AsyncMapping;
-import io.netty.util.concurrent.Future;
-import io.netty.util.concurrent.Promise;
-import org.apache.shenyu.common.exception.ShenyuException;
-import reactor.netty.http.Http11SslContextSpec;
-import reactor.netty.tcp.SslProvider;
-import reactor.netty.tcp.TcpSslContextSpec;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Objects;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.regex.Pattern;
-
-/**
- * Sni async map, can be used to dynamically configure ssl certificates.
- */
-public class ShenyuSniAsyncMapping implements AsyncMapping {
-
- private final ConcurrentHashMap sslProviderMap;
-
- public ShenyuSniAsyncMapping() {
- this.sslProviderMap = new ConcurrentHashMap<>();
- }
-
- public ShenyuSniAsyncMapping(final List sslCrtAndKeys) {
- if (Objects.isNull(sslCrtAndKeys) || sslCrtAndKeys.isEmpty()) {
- throw new ShenyuException("The sslCrtAndKeys can not be null");
- }
- this.sslProviderMap = new ConcurrentHashMap<>();
- sslCrtAndKeys.forEach(sslCrtAndKey -> {
- Http11SslContextSpec sslContextSpec = Http11SslContextSpec.forServer(new File(sslCrtAndKey.getKeyCertChainFile()),
- new File(sslCrtAndKey.getKeyFile()));
- SslProvider sslProvider = SslProvider.builder().sslContext(sslContextSpec).build();
- this.sslProviderMap.put(sslCrtAndKey.getDomain(), sslProvider);
- });
- }
-
- /**
- * Add SslProvider by domain.
- *
- * @param domain domain
- * @param sslProvider SslProvider
- */
- public void addSslProvider(final String domain, final SslProvider sslProvider) {
- sslProviderMap.put(domain, sslProvider);
- }
-
- /**
- * Add ssl config.
- *
- * @param sslCrtAndKey sslCrtAndKey
- * @throws IOException IOException
- */
- public void addSslCertificate(final SslCrtAndKey sslCrtAndKey) throws IOException {
- if (sslCrtAndKey instanceof SslCrtAndKeyFile) {
- SslCrtAndKeyFile sslCrtAndKeyFile = (SslCrtAndKeyFile) sslCrtAndKey;
- TcpSslContextSpec sslContextSpec = TcpSslContextSpec.forServer(new File(sslCrtAndKeyFile.getKeyCertChainFile()),
- new File(sslCrtAndKeyFile.getKeyFile()));
- SslProvider sslProvider = SslProvider.builder().sslContext(sslContextSpec).build();
- this.sslProviderMap.put(sslCrtAndKeyFile.getDomain(), sslProvider);
- } else if (sslCrtAndKey instanceof SslCrtAndKeyStream) {
- SslCrtAndKeyStream sslCrtAndKeyStream = (SslCrtAndKeyStream) sslCrtAndKey;
- sslCrtAndKeyStream.getKeyCertChainInputStream().reset();
- sslCrtAndKeyStream.getKeyInputStream().reset();
- TcpSslContextSpec sslContextSpec = TcpSslContextSpec.forServer(sslCrtAndKeyStream.getKeyCertChainInputStream(),
- sslCrtAndKeyStream.getKeyInputStream());
- SslProvider sslProvider = SslProvider.builder().sslContext(sslContextSpec).build();
- this.sslProviderMap.put(sslCrtAndKeyStream.getDomain(), sslProvider);
- }
- }
-
- /**
- * Remove ssl config by domain.
- *
- * @param domain domain
- */
- public void removeSslCertificate(final String domain) {
- this.sslProviderMap.remove(domain);
- }
-
- /**
- * Get SslProvider by domain.
- *
- * @param domain domain
- * @param promise the promise of SslProvider
- * @return SslProvider Future
- */
- @Override
- public Future map(final String domain, final Promise promise) {
- try {
- for (String key : sslProviderMap.keySet()) {
- if (matchDomain(domain, key)) {
- return promise.setSuccess(sslProviderMap.get(key));
- }
- }
- return promise.setFailure(new ShenyuException(
- String.format("Can not find ssl certificate of domain %s", domain)));
- } catch (Throwable cause) {
- return promise.setFailure(cause);
- }
- }
-
- private boolean matchDomain(final String domain, final String pattern) {
- return Pattern.matches(pattern.replace(".", "\\.").replace("*", ".*"), domain);
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ssl/SslCrtAndKey.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ssl/SslCrtAndKey.java
deleted file mode 100644
index 87531ba..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ssl/SslCrtAndKey.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.config.ssl;
-
-/**
- * ssl certificate and key.
- */
-public interface SslCrtAndKey {
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ssl/SslCrtAndKeyFile.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ssl/SslCrtAndKeyFile.java
deleted file mode 100644
index 8a39a28..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ssl/SslCrtAndKeyFile.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.config.ssl;
-
-/**
- * ssl certificate and key.
- */
-public class SslCrtAndKeyFile implements SslCrtAndKey {
-
- private String domain;
-
- private String keyCertChainFile;
-
- private String keyFile;
-
- public SslCrtAndKeyFile() {
- }
-
- public SslCrtAndKeyFile(final String domain, final String keyCertChainFile, final String keyFile) {
- this.domain = domain;
- this.keyCertChainFile = keyCertChainFile;
- this.keyFile = keyFile;
- }
-
- /**
- * set domain.
- *
- * @param domain domain
- */
- public void setDomain(final String domain) {
- this.domain = domain;
- }
-
- /**
- * set keyCertChainFile.
- *
- * @param keyCertChainFile keyCertChainFile
- */
- public void setKeyCertChainFile(final String keyCertChainFile) {
- this.keyCertChainFile = keyCertChainFile;
- }
-
- /**
- * set keyFile.
- *
- * @param keyFile keyFile
- */
- public void setKeyFile(final String keyFile) {
- this.keyFile = keyFile;
- }
-
- /**
- * get domain.
- *
- * @return domain
- */
- public String getDomain() {
- return domain;
- }
-
- /**
- * get keyCertChainFile.
- *
- * @return keyCertChainFile
- */
- public String getKeyCertChainFile() {
- return keyCertChainFile;
- }
-
- /**
- * get keyFile.
- *
- * @return keyFile
- */
- public String getKeyFile() {
- return keyFile;
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ssl/SslCrtAndKeyStream.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ssl/SslCrtAndKeyStream.java
deleted file mode 100644
index 67728bc..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/config/ssl/SslCrtAndKeyStream.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.config.ssl;
-
-import java.io.InputStream;
-
-/**
- * ssl certificate and key.
- */
-public class SslCrtAndKeyStream implements SslCrtAndKey {
-
- private String domain;
-
- private InputStream keyCertChainInputStream;
-
- private InputStream keyInputStream;
-
- public SslCrtAndKeyStream() {
- }
-
- public SslCrtAndKeyStream(final String domain, final InputStream keyCertChainInputStream, final InputStream keyInputStream) {
- this.domain = domain;
- this.keyCertChainInputStream = keyCertChainInputStream;
- this.keyInputStream = keyInputStream;
- }
-
- /**
- * get domain.
- *
- * @return domain
- */
- public String getDomain() {
- return domain;
- }
-
- /**
- * get keyCertChainInputStream.
- *
- * @return keyCertChainInputStream
- */
- public InputStream getKeyCertChainInputStream() {
- return keyCertChainInputStream;
- }
-
- /**
- * get keyInputStream.
- *
- * @return keyInputStream
- */
- public InputStream getKeyInputStream() {
- return keyInputStream;
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/AdminConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/AdminConstants.java
deleted file mode 100644
index d3316a2..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/AdminConstants.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-/**
- * The type Admin constants.
- */
-public final class AdminConstants {
-
- /**
- * The constant SUCCESS, equals to ShenyuResultMessage.SUCCESS.
- */
- public static final String SUCCESS = "SUCCESS";
-
- /**
- * The constant PLUGIN_NAME_IS_EXIST.
- */
- public static final String PLUGIN_NAME_IS_EXIST = "The plugin name already exists and can't be added repeatedly!";
-
- /**
- * The constant RESOURCE_NAME_IS_EXIST.
- */
- public static final String RESOURCE_NAME_IS_EXIST = "The resource name already exists and can't be added repeatedly!";
-
- /**
- * The constant ID_NOT_EXIST.
- */
- public static final String ID_NOT_EXIST = "ID NOT EXIST!";
-
- /**
- * The constant PLUGIN_NAME_NOT_EXIST.
- */
- public static final String PLUGIN_NAME_NOT_EXIST = "The plugin name not exist!";
-
- /**
- * The constant SYS_PLUGIN_NOT_DELETE.
- */
- public static final String SYS_PLUGIN_NOT_DELETE = "System plugins can't be deleted!";
-
- /**
- * The constant SYS_PLUGIN_ID_NOT_EXIST.
- */
- public static final String SYS_PLUGIN_ID_NOT_EXIST = "The plugin(s) does not exist!";
-
- /**
- * The constant SYS_API_ID_NOT_EXIST.
- */
- public static final String SYS_API_ID_NOT_EXIST = "The api(s) does not exist!";
-
- /**
- * The constant DATA_PATH_IS_EXIST.
- */
- public static final String DATA_PATH_IS_EXIST = "The path already exists and can't be added repeatedly!";
-
- /**
- * The constant PARAMS_ERROR.
- */
- public static final String PARAMS_ERROR = "Error parameter!";
-
- /**
- * The constant Super Role ID.
- */
- public static final String ROLE_SUPER_ID = "1346358560427216896";
-
- /**
- * The constant Plugin Menu ID.
- */
- public static final String RESOURCE_PLUGIN_ID = "1346775491550474240";
-
- /**
- * The constant Plugin Url prefix.
- */
- public static final String RESOURCE_PLUGIN_URL_PREFIX = "/plug/";
-
- /**
- * The constant Plugin Resource Icon.
- */
- public static final String RESOURCE_PLUGIN_DEFAULT_ICON = "block";
-
- /**
- * The constant Selector Name.
- */
- public static final String DATA_PERMISSION_SELECTOR = "selector";
-
- /**
- * The constant Rule Name.
- */
- public static final String DATA_PERMISSION_RULE = "rule";
-
- /**
- * The constant Admin Name.
- */
- public static final String ADMIN_NAME = "admin";
-
- /**
- * The constant selector data type.
- */
- public static final Integer SELECTOR_DATA_TYPE = 0;
-
- /**
- * the constant rule data type.
- */
- public static final Integer RULE_DATA_TYPE = 1;
-
- /**
- * the constant selector add.
- */
- public static final String PLUGIN_SELECTOR_ADD = "SHENYU.BUTTON.PLUGIN.SELECTOR.ADD";
-
- /**
- * the constant selector type add.
- */
- public static final String PLUGIN_TYPE_SELECTOR_ADD = "Selector:add";
-
- /**
- * the constant selector query.
- */
- public static final String PLUGIN_SELECTOR_QUERY = "SHENYU.BUTTON.PLUGIN.SELECTOR.QUERY";
-
- /**
- * the constant selector type query.
- */
- public static final String PLUGIN_TYPE_SELECTOR_QUERY = "Selector:query";
-
- /**
- * the constant selector edit.
- */
- public static final String PLUGIN_SELECTOR_EDIT = "SHENYU.BUTTON.PLUGIN.SELECTOR.EDIT";
-
- /**
- * the constant selector type edit.
- */
- public static final String PLUGIN_TYPE_SELECTOR_EDIT = "Selector:edit";
-
- /**
- * the constant selector delete.
- */
- public static final String PLUGIN_SELECTOR_DELETE = "SHENYU.BUTTON.PLUGIN.SELECTOR.DELETE";
-
- /**
- * the constant selector type delete.
- */
- public static final String PLUGIN_TYPE_SELECTOR_DELETE = "Selector:delete";
-
- /**
- * the constant rule add.
- */
- public static final String PLUGIN_RULE_ADD = "SHENYU.BUTTON.PLUGIN.RULE.ADD";
-
- /**
- * the constant rule type add.
- */
- public static final String PLUGIN_TYPE_RULE_ADD = "Rule:add";
-
- /**
- * the constant rule query.
- */
- public static final String PLUGIN_RULE_QUERY = "SHENYU.BUTTON.PLUGIN.RULE.QUERY";
-
- /**
- * the constant rule type query.
- */
- public static final String PLUGIN_TYPE_RULE_QUERY = "Rule:query";
-
- /**
- * the constant rule edit.
- */
- public static final String PLUGIN_RULE_EDIT = "SHENYU.BUTTON.PLUGIN.RULE.EDIT";
-
- /**
- * the constant rule type edit.
- */
- public static final String PLUGIN_TYPE_RULE_EDIT = "Rule:edit";
-
- /**
- * the constant rule delete.
- */
- public static final String PLUGIN_RULE_DELETE = "SHENYU.BUTTON.PLUGIN.RULE.DELETE";
-
- /**
- * the constant rule type delete.
- */
- public static final String PLUGIN_TYPE_RULE_DELETE = "Rule:delete";
-
- /**
- * the constant plugin synchronize.
- */
- public static final String PLUGIN_SYNCHRONIZE = "SHENYU.BUTTON.PLUGIN.SYNCHRONIZE";
-
- /**
- * the constant plugin type modify.
- */
- public static final String PLUGIN_TYPE_SYNCHRONIZE = ":modify";
-
- /**
- * the constant table init dict type.
- */
- public static final String DICT_TABLE_FLAG_TYPE = "table";
-
- /**
- * the constant table init dict code.
- */
- public static final String DICT_TABLE_FLAG_DICTCODE = "INIT_FLAG";
-
- /**
- * the constant table init dict name.
- */
- public static final String DICT_TABLE_FLAG_DICTNAME = "status";
-
- /**
- * the constant table init dict desc.
- */
- public static final String DICT_TABLE_FLAG_DESC = "table(resource,permission) init status";
-
- /**
- * the constant table init dict sort.
- */
- public static final Integer DICT_TABLE_FLAG_SORT = 0;
-
- /**
- * The constant URI_SUFFIX.
- */
- public static final String URI_SUFFIX = "/**";
-
- /**
- * The constant URI_SLASH_SUFFIX.
- */
- public static final String URI_SLASH_SUFFIX = "/";
-
- /**
- * The constant URI_VARIABLE_SUFFIX.
- */
- public static final String URI_VARIABLE_SUFFIX = "{";
-
- /**
- * the constant api document global flag dict code.
- */
- public static final String DICT_API_DOC_FLAG_DICTCODE = "API_DOC_GLOBAL_FLAG";
-
- /**
- * the constant api document global flag dict name.
- */
- public static final String DICT_API_DOC_FLAG_DICTNAME = "status";
-
- /**
- * the constant api document environment dict name.
- */
- public static final String DICT_TYPE_API_DOC_ENV = "apidocEnv";
-
- public static final String TAG_ROOT_PARENT_ID = "0";
-
- public static final String THE_PLUGIN_JAR_FILE_IS_NOT_CORRECT_OR_EXCEEDS_16_MB = "The plugin JAR file is not correct or exceeds 16MB!";
-
- public static final String PLUGIN_INTERFACE_PATH = "org.apache.shenyu.plugin.api.ShenyuPlugin";
-
- public static final String PLUGIN_ABSTRACR_PATH = "org.apache.shenyu.plugin.base.AbstractShenyuPlugin";
-
- public static final String PROXY_SELECTOR_NAME_IS_EXIST = "The proxy selector name already exists and can't be added repeatedly!";
-
- public static final String PROXY_SELECTOR_ID_IS_NOT_EXIST = "The proxy selector(s) does not exist";
-
- public static final long THE_ONE_DAY_MILLIS_TIME = 24 * 60 * 60 * 1000L;
-
- public static final long FIVE_SECONDS_MILLIS_TIME = 5 * 1000L;
-
- public static final long TEN_SECONDS_MILLIS_TIME = 10 * 1000L;
-}
-
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/ApolloPathConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/ApolloPathConstants.java
deleted file mode 100644
index e2a7c7d..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/ApolloPathConstants.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * apollo path.
- */
-public class ApolloPathConstants {
-
- /**
- * apollo config default group.
- */
- public static final String GROUP = "DEFAULT_GROUP";
-
- /**
- * plugin data id.
- */
- public static final String PLUGIN_DATA_ID = "plugin";
-
- /**
- * selector data id.
- */
- public static final String SELECTOR_DATA_ID = "selector";
-
- /**
- * rule data id.
- */
- public static final String RULE_DATA_ID = "rule";
-
- /**
- * auth data id.
- */
- public static final String AUTH_DATA_ID = "auth";
-
- /**
- * meta data id.
- */
- public static final String META_DATA_ID = "meta";
-
- /**
- * proxy selector data id.
- */
- public static final String PROXY_SELECTOR_DATA_ID = "proxy.selector";
-
- /**
- * proxy selector data id.
- */
- public static final String DISCOVERY_DATA_ID = "discovery";
-
- /**
- * register metadata id.
- */
- public static final String REGISTER_METADATA_ID = "shenyu.register.metadata";
-
- /**
- * register uri id.
- */
- public static final String REGISTER_URI_ID = "shenyu.register.uri";
-
- /**
- * default value of get config.
- */
- public static final String EMPTY_CONFIG_DEFAULT_VALUE = "{}";
-
- /**
- * default time out of get config.
- */
- public static final long DEFAULT_TIME_OUT = 6000;
-
- /**
- * get path key set.
- *
- * @return path key set
- */
- public static Set pathKeySet() {
- return new HashSet<>(Arrays.asList(PLUGIN_DATA_ID, SELECTOR_DATA_ID, RULE_DATA_ID, AUTH_DATA_ID,
- META_DATA_ID, PROXY_SELECTOR_DATA_ID, DISCOVERY_DATA_ID));
- }
-}
-
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/ConsulConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/ConsulConstants.java
deleted file mode 100644
index 2f4c60e..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/ConsulConstants.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-/**
- * Consul constants.
- */
-public final class ConsulConstants {
-
- public static final String SYNC_PRE_FIX = "shenyu/sync";
-
- /**
- * plugin data path.
- */
- public static final String PLUGIN_DATA = SYNC_PRE_FIX + "/plugin";
-
- /**
- * selector data path.
- */
- public static final String SELECTOR_DATA = SYNC_PRE_FIX + "/selector";
-
- /**
- * rule data path.
- */
- public static final String RULE_DATA = SYNC_PRE_FIX + "/rule";
-
- /**
- * auth data path.
- */
- public static final String AUTH_DATA = SYNC_PRE_FIX + "/auth";
-
- /**
- * meta data path.
- */
- public static final String META_DATA = SYNC_PRE_FIX + "/meta";
-
- /**
- * proxy selector data id.
- */
- public static final String PROXY_SELECTOR_DATA_ID = SYNC_PRE_FIX + "/proxySelector";
-
- /**
- * The constant DISCOVERY_UPSTREAM.
- */
- public static final String DISCOVERY_UPSTREAM = SYNC_PRE_FIX + "/discoveryUpstream";
-
- /**
- * default value of get config.
- */
- public static final String EMPTY_CONFIG_DEFAULT_VALUE = "{}";
-
- /**
- * default value of config version index.
- */
- public static final Long INIT_CONFIG_VERSION_INDEX = -1L;
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/DefaultNodeConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/DefaultNodeConstants.java
deleted file mode 100644
index 884d909..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/DefaultNodeConstants.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-/**
- * DefaultNodeConstants.
- */
-public final class DefaultNodeConstants implements Constants {
-
- /**
- * JOIN_POINT.
- */
- public static final String JOIN_POINT = ".";
-
- /**
- * POINT_LIST.
- */
- public static final String POINT_LIST = ".list";
-
- /**
- * LIST_STR.
- */
- public static final String LIST_STR = "list";
-
- /**
- * EMPTY_ARRAY_STR.
- */
- public static final String EMPTY_ARRAY_STR = "[]";
-
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/DefaultPathConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/DefaultPathConstants.java
deleted file mode 100644
index ff14dc0..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/DefaultPathConstants.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-/**
- * DefaultPathConstants.
- */
-public final class DefaultPathConstants implements Constants {
-
- /**
- * The constant SELECTOR_JOIN_RULE.
- */
- public static final String SELECTOR_JOIN_RULE = "-";
-
- private static final String PRE_FIX = "/shenyu";
-
- /**
- * The constant PLUGIN_PARENT.
- */
- public static final String PLUGIN_PARENT = PRE_FIX + "/plugin";
-
- /**
- * The constant SELECTOR_PARENT.
- */
- public static final String SELECTOR_PARENT = PRE_FIX + "/selector";
-
- public static final String RULE_PARENT = PRE_FIX + "/rule";
-
- /**
- * The constant APP_AUTH_PARENT.
- */
- public static final String APP_AUTH_PARENT = PRE_FIX + "/auth";
-
- /**
- * The constant META_DATA.
- */
- public static final String META_DATA = PRE_FIX + "/metaData";
-
- /**
- * The constant PROXY_SELECTOR.
- */
- public static final String PROXY_SELECTOR = PRE_FIX + "/proxySelectorData";
-
- /**
- * The constant DISCOVERY_UPSTREAM.
- */
- public static final String DISCOVERY_UPSTREAM = PRE_FIX + "/discoveryUpstream";
-
- /**
- * acquire app_auth_path.
- *
- * @param appKey appKey
- * @return app_auth_path string
- */
- public static String buildAppAuthPath(final String appKey) {
- return String.join(PATH_SEPARATOR, APP_AUTH_PARENT, appKey);
- }
-
- /**
- * Build meta data path string.
- *
- * @param path the path
- * @return the string
- */
- public static String buildMetaDataPath(final String path) {
- String join = String.join(PATH_SEPARATOR, META_DATA, path);
- return join.replaceAll("//", PATH_SEPARATOR);
- }
-
- /**
- * buildPluginParentPath.
- *
- * @return zk path for plugin
- */
- public static String buildPluginParentPath() {
- return String.join(PATH_SEPARATOR, PLUGIN_PARENT);
- }
-
- /**
- * buildPluginRealPath.
- *
- * @param pluginName pluginName
- * @return zk path for plugin
- */
- public static String buildPluginPath(final String pluginName) {
- return String.join(PATH_SEPARATOR, PLUGIN_PARENT, pluginName);
- }
-
- /**
- * buildSelectorParentPath.
- *
- * @param pluginName pluginName
- * @return zk path for selector
- */
- public static String buildSelectorParentPath(final String pluginName) {
- return String.join(PATH_SEPARATOR, SELECTOR_PARENT, pluginName);
- }
-
- /**
- * buildSelectorRealPath.
- *
- * @param pluginName pluginName
- * @param selectorId selectorId
- * @return zk full path for selector
- */
- public static String buildSelectorRealPath(final String pluginName, final String selectorId) {
- return String.join(PATH_SEPARATOR, SELECTOR_PARENT, pluginName, selectorId);
- }
-
- /**
- * buildRuleParentPath.
- *
- * @param pluginName pluginName
- * @return zk rule parent path.
- */
- public static String buildRuleParentPath(final String pluginName) {
- return String.join(PATH_SEPARATOR, RULE_PARENT, pluginName);
- }
-
- /**
- * buildRulePath.
- *
- * @param pluginName pluginName
- * @param selectorId selectorId
- * @param ruleId ruleId
- * @return /shenyu/rule/pluginName/selectorId-ruleId
- */
- public static String buildRulePath(final String pluginName, final String selectorId, final String ruleId) {
- return String.join(PATH_SEPARATOR, buildRuleParentPath(pluginName), String.join(SELECTOR_JOIN_RULE, selectorId, ruleId));
- }
-
- /**
- * buildProxySelector.
- *
- * @param pluginName pluginName
- * @param proxySelectorName selectorId
- * @return /shenyu/proxySelectorData/pluginName/proxySelectorName
- */
- public static String buildProxySelectorPath(final String pluginName, final String proxySelectorName) {
- return String.join(PATH_SEPARATOR, PROXY_SELECTOR, pluginName, proxySelectorName);
- }
-
- /**
- * buildDiscoveryUpstreamPath.
- *
- * @param pluginName pluginName
- * @param proxySelectorName selectorId
- * @return /shenyu/discoveryUpstream/pluginName/proxySelectorName
- */
- public static String buildDiscoveryUpstreamPath(final String pluginName, final String proxySelectorName) {
- return String.join(PATH_SEPARATOR, DISCOVERY_UPSTREAM, pluginName, proxySelectorName);
- }
-
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/DubboParamConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/DubboParamConstants.java
deleted file mode 100644
index 4047a40..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/DubboParamConstants.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-/**
- * DubboParamConstants.
- */
-public final class DubboParamConstants {
-
- /**
- * The constant PARAM_CLASS.
- */
- public static final String PARAM_CLASS = "paramClass";
-
- /**
- * The constant CLASS_PARAMS.
- */
- public static final String CLASS_PARAMS = "classParams";
-
- /**
- * The constant PARAMS.
- */
- public static final String PARAMS = "params";
-
- /**
- * The constant INTERFACE_NAME.
- */
- public static final String INTERFACE_NAME = "interfaceName";
-
- /**
- * The constant METHOD.
- */
- public static final String METHOD = "method";
-
- /**
- * The constant TIMEOUT.
- */
- public static final String TIMEOUT = "timeout";
-
- /**
- * The constant VERSION.
- */
- public static final String VERSION = "version";
-
- /**
- * The constant GROUP.
- */
- public static final String GROUP = "group";
-
- /**
- * The constant RETRIES.
- */
- public static final String RETRIES = "retries";
-
- /**
- * The constant LOADBALANCE.
- */
- public static final String LOADBALANCE = "loadbalance";
-
- /**
- * The constant url.
- */
- public static final String URL = "url";
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/ExportImportConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/ExportImportConstants.java
deleted file mode 100644
index 9df9c31..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/ExportImportConstants.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-/**
- * Export/Import path constants.
- */
-public final class ExportImportConstants {
- /**
- * export config file name.
- */
- public static final String EXPORT_CONFIG_FILE_NAME = "shenyu_config_export_";
-
- /**
- * export config file name ext.
- */
- public static final String EXPORT_CONFIG_FILE_NAME_EXT = ".zip";
-
- /**
- * export config file name date format.
- */
- public static final String EXPORT_CONFIG_FILE_NAME_DATE_FORMAT = "yyyyMMddHHmmss";
-
- /**
- * plugin json config name.
- */
- public static final String PLUGIN_JSON = "plugin.json";
-
- /**
- * selector json config name.
- */
- public static final String SELECTOR_JSON = "selector.json";
-
- /**
- * rule json config name.
- */
- public static final String RULE_JSON = "rule.json";
-
- /**
- * meta json config name.
- */
- public static final String META_JSON = "meta.json";
-
- /**
- * auth json config name.
- */
- public static final String AUTH_JSON = "auth.json";
-
- /**
- * dict json config name.
- */
- public static final String DICT_JSON = "dict.json";
-
- /**
- * proxy_selector json config name.
- */
- public static final String PROXY_SELECTOR_JSON = "proxy_selector.json";
-
- /**
- * discovery json config name.
- */
- public static final String DISCOVERY_JSON = "discovery.json";
-
- /**
- * discovery_upstream json config name.
- */
- public static final String DISCOVERY_UPSTREAM_JSON = "discovery_upstream.json";
-
- /**
- * plugin import success count.
- */
- public static final String PLUGIN_IMPORT_SUCCESS_COUNT = "pluginImportSuccessCount";
-
- /**
- * plugin import fail message.
- */
- public static final String PLUGIN_IMPORT_FAIL_MESSAGE = "pluginImportFailMessage";
-
- /**
- * selector import success count.
- */
- public static final String SELECTOR_IMPORT_SUCCESS_COUNT = "selectorImportSuccessCount";
-
- /**
- * selector import fail message.
- */
- public static final String SELECTOR_IMPORT_FAIL_MESSAGE = "selectorImportFailMessage";
-
- /**
- * rule import success count.
- */
- public static final String RULE_IMPORT_SUCCESS_COUNT = "ruleImportSuccessCount";
-
- /**
- * rule import fail message.
- */
- public static final String RULE_IMPORT_FAIL_MESSAGE = "ruleImportFailMessage";
-
- /**
- * dict import success count.
- */
- public static final String DICT_IMPORT_SUCCESS_COUNT = "dictImportSuccessCount";
-
- /**
- * dict import fail message.
- */
- public static final String DICT_IMPORT_FAIL_MESSAGE = "dictImportFailMessage";
-
- /**
- * proxy_selector import success count.
- */
- public static final String PROXY_SELECTOR_IMPORT_SUCCESS_COUNT = "proxySelectorImportSuccessCount";
-
- /**
- * proxy_selector import fail message.
- */
- public static final String PROXY_SELECTOR_IMPORT_FAIL_MESSAGE = "proxySelectorImportFailMessage";
-
- /**
- * discovery import success count.
- */
- public static final String DISCOVERY_IMPORT_SUCCESS_COUNT = "discoveryImportSuccessCount";
-
- /**
- * discovery import fail message.
- */
- public static final String DISCOVERY_IMPORT_FAIL_MESSAGE = "discoveryImportFailMessage";
-
- /**
- * discoveryUpstream import success count.
- */
- public static final String DISCOVERY_UPSTREAM_IMPORT_SUCCESS_COUNT = "discoveryUpstreamImportSuccessCount";
-
- /**
- * discoveryUpstream import fail message.
- */
- public static final String DISCOVERY_UPSTREAM_IMPORT_FAIL_MESSAGE = "discoveryUpstreamImportFailMessage";
-
- /**
- * auth import success count.
- */
- public static final String AUTH_IMPORT_SUCCESS_COUNT = "authImportSuccessCount";
-
- /**
- * auth import fail message.
- */
- public static final String AUTH_IMPORT_FAIL_MESSAGE = "authImportFailMessage";
-
- /**
- * meta import success count.
- */
- public static final String META_IMPORT_SUCCESS_COUNT = "metaImportSuccessCount";
-
- /**
- * meta import fail message.
- */
- public static final String META_IMPORT_FAIL_MESSAGE = "metaImportFailMessage";
-
-
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/HttpConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/HttpConstants.java
deleted file mode 100644
index 7d29fd8..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/HttpConstants.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-import java.util.concurrent.TimeUnit;
-
-/**
- * constants for http, including http long polling.
- *
- * @since 2.0.0
- */
-public final class HttpConstants {
-
- /**
- * Client long polling timeout is 90s.
- */
- public static final long CLIENT_POLLING_READ_TIMEOUT = TimeUnit.SECONDS.toMillis(90);
-
- /**
- * The maximum timeout of server block is 60s.
- */
- public static final long SERVER_MAX_HOLD_TIMEOUT = TimeUnit.SECONDS.toMillis(60);
-
- /**
- * Default connection timeout is 10s.
- */
- public static final long CLIENT_POLLING_CONNECT_TIMEOUT = TimeUnit.SECONDS.toMillis(10);
-
- /**
- * Default write timeout is 90s.
- */
- public static final long CLIENT_POLLING_WRITE_TIMEOUT = TimeUnit.SECONDS.toMillis(90);
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/NacosPathConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/NacosPathConstants.java
deleted file mode 100644
index c9cccd9..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/NacosPathConstants.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-/**
- * Nacos path constants.
- */
-public final class NacosPathConstants {
-
- /**
- * Nacos config default group.
- */
- public static final String GROUP = "DEFAULT_GROUP";
-
- /**
- * plugin data id.
- */
- public static final String PLUGIN_DATA_ID = "plugin";
-
- /**
- * selector data id.
- */
- public static final String SELECTOR_DATA_ID = "selector";
-
- /**
- * rule data id.
- */
- public static final String RULE_DATA_ID = "rule";
-
- /**
- * auth data id.
- */
- public static final String AUTH_DATA_ID = "auth";
-
- /**
- * meta data id.
- */
- public static final String META_DATA_ID = "meta";
-
- /**
- * proxy selector data id.
- */
- public static final String PROXY_SELECTOR_DATA_ID = "proxy.selector";
-
- /**
- * proxy selector data id.
- */
- public static final String DISCOVERY_DATA_ID = "discovery";
-
- /**
- * default value of get config.
- */
- public static final String EMPTY_CONFIG_DEFAULT_VALUE = "{}";
-
- /**
- * default time out of get config.
- */
- public static final long DEFAULT_TIME_OUT = 6000;
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/PolarisPathConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/PolarisPathConstants.java
deleted file mode 100644
index 43e195f..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/PolarisPathConstants.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-/**
- * Polaris path constants.
- */
-public final class PolarisPathConstants {
-
- /**
- * Polaris config default namespace.
- */
- public static final String NAMESPACE = "default";
-
- /**
- * Polaris file group.
- */
- public static final String FILE_GROUP = "shenyu";
-
- /**
- * auth data id.
- */
- public static final String AUTH_DATA_ID_FILE_NAME = "auth";
-
- /**
- * plugin data id.
- */
- public static final String PLUGIN_DATA_FILE_NAME = "plugin";
-
- /**
- * selector data id.
- */
- public static final String SELECTOR_DATA_FILE_NAME = "selector";
-
- /**
- * rule data id.
- */
- public static final String RULE_DATA_FILE_NAME = "rule";
-
- /**
- * meta data id.
- */
- public static final String META_DATA_FILE_NAME = "meta";
-
- /**
- * proxy selector data id.
- */
- public static final String PROXY_SELECTOR_FILE_NAME = "proxy.selector";
-
- /**
- * default value of get config.
- */
- public static final String EMPTY_CONFIG_DEFAULT_VALUE = "{}";
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/RedisKeyConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/RedisKeyConstants.java
deleted file mode 100644
index 3f098e0..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/RedisKeyConstants.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-/**
- * RedisKeyConstants.
- */
-public final class RedisKeyConstants implements Constants {
-
- /**
- * The constant PLUGIN.
- */
- public static final String PLUGIN = "plugin";
-
- /**
- * The constant SELECTOR.
- */
- public static final String SELECTOR = "selector";
-
- /**
- * The constant RULE.
- */
- public static final String RULE = "rule";
-
- private static final String PLUGIN_INFO = ":info";
-
- private static final String PLUGIN_SELECTOR = ":selector";
-
- /**
- * this is a function.
- *
- * @param pluginName pluginName
- * @return java.lang.String string
- */
- public static String pluginInfoKey(final String pluginName) {
- return String.join("", pluginName, PLUGIN_INFO);
-
- }
-
- /**
- * this is a function.
- *
- * @param pluginName pluginName
- * @return java.lang.String string
- */
- public static String pluginSelectorKey(final String pluginName) {
- return String.join("", pluginName, PLUGIN_SELECTOR);
-
- }
-
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/ResourceTypeConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/ResourceTypeConstants.java
deleted file mode 100644
index e140313..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/ResourceTypeConstants.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-/**
- * The Constants for Resource Type.
- */
-public final class ResourceTypeConstants {
-
- /**
- * Permission.
- */
- public static final Integer MENU_TYPE_2 = 2;
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/RuleHandleConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/RuleHandleConstants.java
deleted file mode 100644
index df8e4f4..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/RuleHandleConstants.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-import org.apache.shenyu.common.enums.LoadBalanceEnum;
-
-/**
- * The Constants for RuleHandles.
- */
-public final class RuleHandleConstants {
-
- /**
- * Default load balance for RuleHandle.
- */
- public static final LoadBalanceEnum DEFAULT_LOAD_BALANCE = LoadBalanceEnum.RANDOM;
-
- /**
- * Default timeout for RuleHandle.
- */
- public static final long DEFAULT_TIMEOUT = 3000;
-
- /**
- * Default retries for RuleHandle.
- */
- public static final int DEFAULT_RETRIES = 0;
-
- /**
- * Default retry for RuleHandle.
- */
- public static final int DEFAULT_RETRY = 0;
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/RunningModeConstants.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/RunningModeConstants.java
deleted file mode 100644
index 6f1f4cc..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/constant/RunningModeConstants.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.constant;
-
-/**
- * running mode constants.
- */
-public class RunningModeConstants {
-
- /**
- * The constant eventType.
- */
- public static final String EVENT_TYPE = "eventType";
-
- /**
- * The constant runningMode.
- */
- public static final String RUNNING_MODE = "runningMode";
-
- /**
- * The constant masterUrl.
- */
- public static final String MASTER_URL = "masterUrl";
-
- /**
- * The constant isMaster.
- */
- public static final String IS_MASTER = "isMaster";
-
- /**
- * The constant CLUSTER.
- */
- public static final String CLUSTER = "CLUSTER";
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/AlarmContent.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/AlarmContent.java
deleted file mode 100644
index fa0ed0d..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/AlarmContent.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import java.util.Date;
-import java.util.Map;
-
-/**
- * AlertContent.
- */
-public final class AlarmContent {
-
- /**
- * primary key id.
- */
- private Long id;
-
- /**
- * alert title.
- */
- private String title;
-
- /**
- * Alarm level.
- * 0: high-emergency-critical alarm-red.
- * 1: medium-critical-critical alarm-orange.
- * 2: low-warning-warning alarm-yellow
- */
- private byte level;
-
- /**
- * alert labels.
- */
- private Map labels;
-
- /**
- * The actual content of the alarm notification.
- */
- private String content;
-
- /**
- * create time.
- */
- private Date dateCreated;
-
- /**
- * update time.
- */
- private Date dateUpdated;
-
- private AlarmContent() {
- }
-
- private AlarmContent(final Builder builder) {
- setTitle(builder.title);
- setLevel(builder.level);
- setLabels(builder.labels);
- setContent(builder.content);
- setDateCreated(builder.dateCreated);
- setDateUpdated(builder.dateUpdated);
- }
-
- /**
- * get id.
- *
- * @return id
- */
- public Long getId() {
- return id;
- }
-
- /**
- * set id.
- *
- * @param id id
- */
- public void setId(final Long id) {
- this.id = id;
- }
-
- /**
- * get title.
- * @return title
- */
- public String getTitle() {
- return title;
- }
-
- /**
- * set title.
- * @param title title
- */
- public void setTitle(final String title) {
- this.title = title;
- }
-
- /**
- * get level.
- * @return level
- */
- public byte getLevel() {
- return level;
- }
-
- /**
- * set level.
- * @param level level
- */
- public void setLevel(final byte level) {
- this.level = level;
- }
-
- /**
- * get labels.
- * @return labels
- */
- public Map getLabels() {
- return labels;
- }
-
- /**
- * set labels.
- * @param labels labels
- */
- public void setLabels(final Map labels) {
- this.labels = labels;
- }
-
- /**
- * get content.
- *
- * @return content
- */
- public String getContent() {
- return content;
- }
-
- /**
- * set content.
- *
- * @param content content
- */
- public void setContent(final String content) {
- this.content = content;
- }
-
- /**
- * get dateCreated.
- *
- * @return dateCreated
- */
- public Date getDateCreated() {
- return dateCreated;
- }
-
- /**
- * set dateCreated.
- *
- * @param dateCreated dateCreated
- */
- public void setDateCreated(final Date dateCreated) {
- this.dateCreated = dateCreated;
- }
-
- /**
- * get dateUpdated.
- *
- * @return dateUpdated
- */
- public Date getDateUpdated() {
- return dateUpdated;
- }
-
- /**
- * set dateUpdated.
- *
- * @param dateUpdated dateUpdated
- */
- public void setDateUpdated(final Date dateUpdated) {
- this.dateUpdated = dateUpdated;
- }
-
-
- /**
- * builder.
- */
- public static final class Builder {
- /**
- * alert title.
- */
- private String title;
-
- /**
- * Alarm level.
- * 0: high-emergency-critical alarm-red.
- * 1: medium-critical-critical alarm-orange.
- * 2: low-warning-warning alarm-yellow
- */
- private byte level;
-
- /**
- * alert labels.
- */
- private Map labels;
-
- /**
- * The actual content of the alarm notification.
- */
- private String content;
-
- /**
- * create time.
- */
- private Date dateCreated;
-
- /**
- * update time.
- */
- private Date dateUpdated;
-
- /**
- * builder constructor.
- */
- public Builder() {
- }
-
- /**
- * builder constructor.
- * @param val title
- * @return builder
- */
- public Builder title(final String val) {
- title = val;
- return this;
- }
-
- /**
- * builder constructor.
- * @param val level
- * @return level
- */
- public Builder level(final byte val) {
- level = val;
- return this;
- }
-
- /**
- * builder constructor.
- * @param val labels
- * @return builder
- */
- public Builder labels(final Map val) {
- labels = val;
- return this;
- }
-
- /**
- * builder constructor.
- * @param val content
- * @return builder
- */
- public Builder content(final String val) {
- content = val;
- return this;
- }
-
- /**
- * builder constructor.
- * @param val date created
- * @return builder
- */
- public Builder dateCreated(final Date val) {
- dateCreated = val;
- return this;
- }
-
- /**
- * builder constructor.
- * @param val date updated
- * @return builder
- */
- public Builder dateUpdated(final Date val) {
- dateUpdated = val;
- return this;
- }
-
- /**
- * build content.
- * @return alarm content
- */
- public AlarmContent build() {
- return new AlarmContent(this);
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/AppAuthData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/AppAuthData.java
deleted file mode 100644
index 3c2329d..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/AppAuthData.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import java.util.List;
-import java.util.Objects;
-
-/**
- * AppAuthDTO.
- *
- * @since 2.0.0
- */
-public class AppAuthData {
-
- private String appKey;
-
- private String appSecret;
-
- private Boolean enabled;
-
- private Boolean open;
-
- private List paramDataList;
-
- private List pathDataList;
-
- /**
- * no args constructor.
- */
- public AppAuthData() {
- }
-
- /**
- * builder constructor.
- *
- * @param builder builder
- */
- private AppAuthData(final Builder builder) {
- this.appKey = builder.appKey;
- this.appSecret = builder.appSecret;
- this.enabled = builder.enabled;
- this.open = builder.open;
- this.paramDataList = builder.paramDataList;
- this.pathDataList = builder.pathDataList;
- }
-
- /**
- * class builder.
- *
- * @return builder
- */
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * get appKey.
- *
- * @return appKey
- */
- public String getAppKey() {
- return appKey;
- }
-
- /**
- * set appKey.
- *
- * @param appKey appKey
- */
- public void setAppKey(final String appKey) {
- this.appKey = appKey;
- }
-
- /**
- * get appSecret.
- *
- * @return appSecret
- */
- public String getAppSecret() {
- return appSecret;
- }
-
- /**
- * set appSecret.
- *
- * @param appSecret appSecret
- */
- public void setAppSecret(final String appSecret) {
- this.appSecret = appSecret;
- }
-
- /**
- * get enabled.
- *
- * @return enabled
- */
- public Boolean getEnabled() {
- return enabled;
- }
-
- /**
- * set enabled.
- *
- * @param enabled enabled
- */
- public void setEnabled(final Boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * get open.
- *
- * @return open
- */
- public Boolean getOpen() {
- return open;
- }
-
- /**
- * set open.
- *
- * @param open open
- */
- public void setOpen(final Boolean open) {
- this.open = open;
- }
-
- /**
- * get paramDataList.
- *
- * @return paramDataList
- */
- public List getParamDataList() {
- return paramDataList;
- }
-
- /**
- * set paramDataList.
- *
- * @param paramDataList paramDataList
- */
- public void setParamDataList(final List paramDataList) {
- this.paramDataList = paramDataList;
- }
-
- /**
- * get pathDataList.
- *
- * @return pathDataList
- */
- public List getPathDataList() {
- return pathDataList;
- }
-
- /**
- * set pathDataList.
- *
- * @param pathDataList pathDataList
- */
- public void setPathDataList(final List pathDataList) {
- this.pathDataList = pathDataList;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- AppAuthData that = (AppAuthData) o;
- return Objects.equals(appKey, that.appKey) && Objects.equals(appSecret, that.appSecret) && Objects.equals(enabled, that.enabled)
- && Objects.equals(open, that.open) && Objects.equals(paramDataList, that.paramDataList) && Objects.equals(pathDataList, that.pathDataList);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(appKey, appSecret, enabled, open, paramDataList, pathDataList);
- }
-
- @Override
- public String toString() {
- return "AppAuthData{"
- + "appKey='"
- + appKey
- + '\''
- + ", appSecret='"
- + appSecret
- + '\''
- + ", enabled="
- + enabled
- + ", open="
- + open
- + ", paramDataList="
- + paramDataList
- + ", pathDataList="
- + pathDataList
- + '}';
- }
-
- /**
- * class builder.
- */
- public static final class Builder {
-
- /**
- * appKey.
- */
- private String appKey;
-
- /**
- * appSecret.
- */
- private String appSecret;
-
- /**
- * enabled.
- */
- private Boolean enabled;
-
- /**
- * open.
- */
- private Boolean open;
-
- /**
- * paramDataList.
- */
- private List paramDataList;
-
- /**
- * pathDataList.
- */
- private List pathDataList;
-
- /**
- * no args constructor.
- */
- private Builder() {
- }
-
- /**
- * build new Object.
- *
- * @return AppAuthData
- */
- public AppAuthData build() {
- return new AppAuthData(this);
- }
-
- /**
- * build appKey.
- *
- * @param appKey appKey
- * @return this
- */
- public Builder appKey(final String appKey) {
- this.appKey = appKey;
- return this;
- }
-
- /**
- * build appSecret.
- *
- * @param appSecret appSecret
- * @return this
- */
- public Builder appSecret(final String appSecret) {
- this.appSecret = appSecret;
- return this;
- }
-
- /**
- * build enabled.
- *
- * @param enabled enabled
- * @return this
- */
- public Builder enabled(final Boolean enabled) {
- this.enabled = enabled;
- return this;
- }
-
- /**
- * build open.
- *
- * @param open open
- * @return this
- */
- public Builder open(final Boolean open) {
- this.open = open;
- return this;
- }
-
- /**
- * build paramDataList.
- *
- * @param paramDataList paramDataList
- * @return this
- */
- public Builder paramDataList(final List paramDataList) {
- this.paramDataList = paramDataList;
- return this;
- }
-
- /**
- * build pathDataList.
- *
- * @param pathDataList pathDataList
- * @return this
- */
- public Builder pathDataList(final List pathDataList) {
- this.pathDataList = pathDataList;
- return this;
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/AuthParamData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/AuthParamData.java
deleted file mode 100644
index bf1da01..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/AuthParamData.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import java.util.Objects;
-
-/**
- * The type Auth param data.
- */
-public class AuthParamData {
-
- private String appName;
-
- private String appParam;
-
- /**
- * no args constructor.
- */
- public AuthParamData() {
- }
-
- /**
- * all args constructor.
- *
- * @param appName appName
- * @param appParam appParam
- */
- public AuthParamData(final String appName, final String appParam) {
- this.appName = appName;
- this.appParam = appParam;
- }
-
- /**
- * get appName.
- *
- * @return appName
- */
- public String getAppName() {
- return appName;
- }
-
- /**
- * set appName.
- *
- * @param appName appName
- */
- public void setAppName(final String appName) {
- this.appName = appName;
- }
-
- /**
- * get appParam.
- *
- * @return appParam
- */
- public String getAppParam() {
- return appParam;
- }
-
- /**
- * set appParam.
- *
- * @param appParam appParam
- */
- public void setAppParam(final String appParam) {
- this.appParam = appParam;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- AuthParamData that = (AuthParamData) o;
- return Objects.equals(appName, that.appName) && Objects.equals(appParam, that.appParam);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(appName, appParam);
- }
-
- @Override
- public String toString() {
- return "AuthParamData{"
- + "appName='"
- + appName
- + '\''
- + ", appParam='"
- + appParam
- + '\''
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/AuthPathData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/AuthPathData.java
deleted file mode 100644
index f202db2..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/AuthPathData.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import java.util.Objects;
-
-/**
- * The type Auth path data.
- */
-public class AuthPathData {
-
- private String appName;
-
- private String path;
-
- private Boolean enabled;
-
- /**
- * no args constructor.
- */
- public AuthPathData() {
- }
-
- /**
- * all args constructor.
- *
- * @param appName appName
- * @param path path
- * @param enabled enabled
- */
- public AuthPathData(final String appName, final String path, final Boolean enabled) {
- this.appName = appName;
- this.path = path;
- this.enabled = enabled;
- }
-
- /**
- * builder constructor.
- *
- * @param builder builder
- */
- private AuthPathData(final Builder builder) {
- this.appName = builder.appName;
- this.path = builder.path;
- this.enabled = builder.enabled;
- }
-
- /**
- * class builder.
- *
- * @return builder
- */
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * get appName.
- *
- * @return appName
- */
- public String getAppName() {
- return appName;
- }
-
- /**
- * set appName.
- *
- * @param appName appName
- */
- public void setAppName(final String appName) {
- this.appName = appName;
- }
-
- /**
- * get path.
- *
- * @return path
- */
- public String getPath() {
- return path;
- }
-
- /**
- * set path.
- *
- * @param path path
- */
- public void setPath(final String path) {
- this.path = path;
- }
-
- /**
- * get enabled.
- *
- * @return enabled
- */
- public Boolean getEnabled() {
- return enabled;
- }
-
- /**
- * set enabled.
- *
- * @param enabled enabled
- */
- public void setEnabled(final Boolean enabled) {
- this.enabled = enabled;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- AuthPathData that = (AuthPathData) o;
- return Objects.equals(appName, that.appName) && Objects.equals(path, that.path) && Objects.equals(enabled, that.enabled);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(appName, path, enabled);
- }
-
- @Override
- public String toString() {
- return "AuthPathData{"
- + "appName='"
- + appName
- + '\''
- + ", path='"
- + path
- + '\''
- + ", enabled="
- + enabled
- + '}';
- }
-
- /**
- * class builder.
- */
- public static final class Builder {
-
- /**
- * appName.
- */
- private String appName;
-
- /**
- * path.
- */
- private String path;
-
- /**
- * enabled.
- */
- private Boolean enabled;
-
- /**
- * no args constructor.
- */
- private Builder() {
- }
-
- /**
- * build new Object.
- *
- * @return AuthPathData
- */
- public AuthPathData build() {
- return new AuthPathData(this);
- }
-
- /**
- * build appName.
- *
- * @param appName appName
- * @return this
- */
- public Builder appName(final String appName) {
- this.appName = appName;
- return this;
- }
-
- /**
- * build path.
- *
- * @param path path
- * @return this
- */
- public Builder path(final String path) {
- this.path = path;
- return this;
- }
-
- /**
- * build enabled.
- *
- * @param enabled enabled
- * @return this
- */
- public Builder enabled(final Boolean enabled) {
- this.enabled = enabled;
- return this;
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/ConditionData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/ConditionData.java
deleted file mode 100644
index 7c47f02..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/ConditionData.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import java.util.Objects;
-
-/**
- * ConditionDTO.
- *
- * @since 2.0.0
- */
-public class ConditionData {
-
- /**
- * {@linkplain org.apache.shenyu.common.enums.ParamTypeEnum}.
- */
- private String paramType;
-
- /**
- * {@linkplain org.apache.shenyu.common.enums.OperatorEnum}.
- */
- private String operator;
-
- /**
- * param name.
- */
- private String paramName;
-
- /**
- * param value.
- */
- private String paramValue;
-
- /**
- * get paramType.
- *
- * @return paramType
- */
- public String getParamType() {
- return paramType;
- }
-
- /**
- * set paramType.
- *
- * @param paramType paramType
- */
- public void setParamType(final String paramType) {
- this.paramType = paramType;
- }
-
- /**
- * get operator.
- *
- * @return operator
- */
- public String getOperator() {
- return operator;
- }
-
- /**
- * set operator.
- *
- * @param operator operator
- */
- public void setOperator(final String operator) {
- this.operator = operator;
- }
-
- /**
- * get paramName.
- *
- * @return paramName
- */
- public String getParamName() {
- return paramName;
- }
-
- /**
- * set paramName.
- *
- * @param paramName paramName
- */
- public void setParamName(final String paramName) {
- this.paramName = paramName;
- }
-
- /**
- * get paramValue.
- *
- * @return paramValue
- */
- public String getParamValue() {
- return paramValue;
- }
-
- /**
- * set paramValue.
- *
- * @param paramValue paramValue
- */
- public void setParamValue(final String paramValue) {
- this.paramValue = paramValue;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- ConditionData that = (ConditionData) o;
- return Objects.equals(paramType, that.paramType) && Objects.equals(operator, that.operator)
- && Objects.equals(paramName, that.paramName) && Objects.equals(paramValue, that.paramValue);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(paramType, operator, paramName, paramValue);
- }
-
- @Override
- public String toString() {
- return "ConditionData{"
- + "paramType='"
- + paramType
- + '\''
- + ", operator='"
- + operator
- + '\''
- + ", paramName='"
- + paramName
- + '\''
- + ", paramValue='"
- + paramValue
- + '\''
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/ConfigData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/ConfigData.java
deleted file mode 100644
index 3253385..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/ConfigData.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import org.apache.shenyu.common.utils.GsonUtils;
-
-import java.util.List;
-import java.util.Objects;
-
-/**
- * Data set, including {@link AppAuthData}、{@link ConditionData}、{@link PluginData}、{@link RuleData}、{@link SelectorData}.
- *
- * @since 2.0.0
- */
-public class ConfigData {
-
- private String md5;
-
- private long lastModifyTime;
-
- private List data;
-
- /**
- * no args constructor.
- */
- public ConfigData() {
- }
-
- /**
- * all args constructor.
- *
- * @param md5 md5
- * @param lastModifyTime lastModifyTime
- * @param data data
- */
- public ConfigData(final String md5, final long lastModifyTime, final List data) {
- this.md5 = md5;
- this.lastModifyTime = lastModifyTime;
- this.data = data;
- }
-
- /**
- * get md5.
- *
- * @return md5
- */
- public String getMd5() {
- return md5;
- }
-
- /**
- * set md5.
- *
- * @param md5 md5
- * @return this
- */
- public ConfigData setMd5(final String md5) {
- this.md5 = md5;
- return this;
- }
-
- /**
- * get lastModifyTime.
- *
- * @return lastModifyTime
- */
- public long getLastModifyTime() {
- return lastModifyTime;
- }
-
- /**
- * set lastModifyTime.
- *
- * @param lastModifyTime lastModifyTime
- * @return this
- */
- public ConfigData setLastModifyTime(final long lastModifyTime) {
- this.lastModifyTime = lastModifyTime;
- return this;
- }
-
- /**
- * get data.
- *
- * @return data
- */
- public List getData() {
- return data;
- }
-
- /**
- * set data.
- *
- * @param data data
- * @return this
- */
- public ConfigData setData(final List data) {
- this.data = data;
- return this;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- ConfigData> that = (ConfigData>) o;
- return lastModifyTime == that.lastModifyTime && Objects.equals(md5, that.md5) && Objects.equals(data, that.data);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(md5, lastModifyTime, data);
- }
-
- @Override
- public String toString() {
- return GsonUtils.getInstance().toJson(this);
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/DiscoverySyncData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/DiscoverySyncData.java
deleted file mode 100644
index 0f5526b..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/DiscoverySyncData.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import java.util.List;
-
-public class DiscoverySyncData {
-
- /**
- * selectorId.
- */
- private String selectorId;
-
- /**
- * pluginName.
- */
- private String pluginName;
-
- /**
- * selectorName.
- */
- private String selectorName;
-
- /**
- * upstreamDataList.
- */
- private List upstreamDataList;
-
- /**
- * getSelectorId.
- *
- * @return selectorId
- */
- public String getSelectorId() {
- return selectorId;
- }
-
- /**
- * setSelectorId.
- *
- * @param selectorId selectorId
- */
- public void setSelectorId(final String selectorId) {
- this.selectorId = selectorId;
- }
-
- /**
- * getPluginName.
- *
- * @return pluginName
- */
- public String getPluginName() {
- return pluginName;
- }
-
- /**
- * setPluginName.
- *
- * @param pluginName pluginName
- */
- public void setPluginName(final String pluginName) {
- this.pluginName = pluginName;
- }
-
- /**
- * getSelectorName.
- *
- * @return selectorName
- */
- public String getSelectorName() {
- return selectorName;
- }
-
- /**
- * setSelectorName.
- *
- * @param selectorName selectorName
- */
- public void setSelectorName(final String selectorName) {
- this.selectorName = selectorName;
- }
-
-
- /**
- * getUpstreamDataList.
- *
- * @return upstreamDataList
- */
- public List getUpstreamDataList() {
- return upstreamDataList;
- }
-
- /**
- * setUpstreamDataList.
- *
- * @param upstreamDataList upstreamDataList
- */
- public void setUpstreamDataList(final List upstreamDataList) {
- this.upstreamDataList = upstreamDataList;
- }
-
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/DiscoveryUpstreamData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/DiscoveryUpstreamData.java
deleted file mode 100644
index 42bd7fe..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/DiscoveryUpstreamData.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-
-import java.sql.Timestamp;
-import java.util.Objects;
-
-public class DiscoveryUpstreamData {
-
- /**
- * primary key.
- */
- private String id;
-
- /**
- * created time.
- */
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private Timestamp dateCreated;
-
- /**
- * updated time.
- */
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- private Timestamp dateUpdated;
-
-
- /**
- * discoveryHandlerId.
- */
- private String discoveryHandlerId;
-
- /**
- * protocol.
- */
- private String protocol;
-
- /**
- * url.
- */
- private String url;
-
- /**
- * status.
- */
- private int status;
-
- /**
- * weight.
- */
- private int weight;
-
- /**
- * props.
- */
- private String props;
-
-
- /**
- * getDiscoveryHandlerId.
- *
- * @return discoveryHandlerId
- */
- public String getDiscoveryHandlerId() {
- return discoveryHandlerId;
- }
-
- /**
- * setDiscoveryHandlerId.
- *
- * @param discoveryHandlerId discoveryHandlerId
- */
- public void setDiscoveryHandlerId(final String discoveryHandlerId) {
- this.discoveryHandlerId = discoveryHandlerId;
- }
-
- /**
- * getProtocol.
- *
- * @return protocol
- */
- public String getProtocol() {
- return protocol;
- }
-
- /**
- * setProtocol.
- *
- * @param protocol protocol
- */
- public void setProtocol(final String protocol) {
- this.protocol = protocol;
- }
-
- /**
- * getUrl.
- *
- * @return url
- */
- public String getUrl() {
- return url;
- }
-
- /**
- * setUrl.
- *
- * @param url url
- */
- public void setUrl(final String url) {
- this.url = url;
- }
-
- /**
- * getStatus.
- *
- * @return status
- */
- public int getStatus() {
- return status;
- }
-
- /**
- * setStatus.
- *
- * @param status status
- */
- public void setStatus(final int status) {
- this.status = status;
- }
-
- /**
- * getWeight.
- *
- * @return weight
- */
- public int getWeight() {
- return weight;
- }
-
- /**
- * setWeight.
- *
- * @param weight weight
- */
- public void setWeight(final int weight) {
- this.weight = weight;
- }
-
- /**
- * getProps.
- *
- * @return props
- */
- public String getProps() {
- return props;
- }
-
- /**
- * setProps.
- *
- * @param props props
- */
- public void setProps(final String props) {
- this.props = props;
- }
-
- /**
- * Gets the value of id.
- *
- * @return the value of id
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the id.
- *
- * @param id id
- */
- public void setId(final String id) {
- this.id = id;
- }
-
- /**
- * Gets the value of dateCreated.
- *
- * @return the value of dateCreated
- */
- public Timestamp getDateCreated() {
- return dateCreated;
- }
-
- /**
- * Sets the dateCreated.
- *
- * @param dateCreated dateCreated
- */
- public void setDateCreated(final Timestamp dateCreated) {
- this.dateCreated = dateCreated;
- }
-
- /**
- * Gets the value of dateUpdated.
- *
- * @return the value of dateUpdated
- */
- public Timestamp getDateUpdated() {
- return dateUpdated;
- }
-
- /**
- * setDateUpdated.
- *
- * @param dateUpdated dateUpdated
- */
- public void setDateUpdated(final Timestamp dateUpdated) {
- this.dateUpdated = dateUpdated;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- DiscoveryUpstreamData that = (DiscoveryUpstreamData) o;
- return status == that.status && weight == that.weight && Objects.equals(id, that.id)
- && Objects.equals(dateCreated, that.dateCreated) && Objects.equals(dateUpdated, that.dateUpdated)
- && Objects.equals(discoveryHandlerId, that.discoveryHandlerId) && Objects.equals(protocol, that.protocol)
- && Objects.equals(url, that.url) && Objects.equals(props, that.props);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, dateCreated, dateUpdated, discoveryHandlerId, protocol, url, status, weight, props);
- }
-
- /**
- * class builder.
- *
- * @return Builder
- */
- public static DiscoveryUpstreamData.Builder builder() {
- return new DiscoveryUpstreamData.Builder();
- }
-
- public static final class Builder {
-
- private String id;
-
- private Timestamp dateCreated;
-
- private Timestamp dateUpdated;
-
- private String discoveryHandlerId;
-
- private String protocol;
-
- private String url;
-
- private int status;
-
- private int weight;
-
- private String props;
-
- private Builder() {
- }
-
- /**
- * build new Object.
- *
- * @return Builder
- */
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * build id.
- *
- * @param id id
- * @return this
- */
- public Builder id(final String id) {
- this.id = id;
- return this;
- }
-
- /**
- * build dateCreated.
- *
- * @param dateCreated dateCreated
- * @return this
- */
- public Builder dateCreated(final Timestamp dateCreated) {
- this.dateCreated = dateCreated;
- return this;
- }
-
- /**
- * build dateUpdated.
- *
- * @param dateUpdated dateUpdated
- * @return this
- */
- public Builder dateUpdated(final Timestamp dateUpdated) {
- this.dateUpdated = dateUpdated;
- return this;
- }
-
- /**
- * build discoveryHandlerId.
- *
- * @param discoveryHandlerId discoveryHandlerId
- * @return this
- */
- public Builder discoveryHandlerId(final String discoveryHandlerId) {
- this.discoveryHandlerId = discoveryHandlerId;
- return this;
- }
-
- /**
- * build protocol.
- *
- * @param protocol protocol
- * @return this
- */
- public Builder protocol(final String protocol) {
- this.protocol = protocol;
- return this;
- }
-
- /**
- * build url.
- *
- * @param url url
- * @return this
- */
- public Builder url(final String url) {
- this.url = url;
- return this;
- }
-
- /**
- * build status.
- *
- * @param status status
- * @return this
- */
- public Builder status(final int status) {
- this.status = status;
- return this;
- }
-
- /**
- * build weight.
- *
- * @param weight weight
- * @return this
- */
- public Builder weight(final int weight) {
- this.weight = weight;
- return this;
- }
-
- /**
- * build props.
- *
- * @param props props
- * @return this
- */
- public Builder props(final String props) {
- this.props = props;
- return this;
- }
-
- /**
- * build new Object.
- *
- * @return DiscoveryUpstreamData
- */
- public DiscoveryUpstreamData build() {
- DiscoveryUpstreamData discoveryUpstreamData = new DiscoveryUpstreamData();
- discoveryUpstreamData.setId(id);
- discoveryUpstreamData.setDateCreated(dateCreated);
- discoveryUpstreamData.setDateUpdated(dateUpdated);
- discoveryUpstreamData.setDiscoveryHandlerId(discoveryHandlerId);
- discoveryUpstreamData.setProtocol(protocol);
- discoveryUpstreamData.setUrl(url);
- discoveryUpstreamData.setStatus(status);
- discoveryUpstreamData.setWeight(weight);
- discoveryUpstreamData.setProps(props);
- return discoveryUpstreamData;
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/MetaData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/MetaData.java
deleted file mode 100644
index 2eff33f..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/MetaData.java
+++ /dev/null
@@ -1,532 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.Objects;
-
-public class MetaData {
-
- private String id;
-
- private String appName;
-
- private String contextPath;
-
- private String path;
-
- private String rpcType;
-
- private String serviceName;
-
- private String methodName;
-
- private String parameterTypes;
-
- private String rpcExt;
-
- private Boolean enabled;
-
- /**
- * no args constructor.
- */
- public MetaData() {
- }
-
- /**
- * all args constructor.
- *
- * @param id id
- * @param appName appName
- * @param contextPath contextPath
- * @param path path
- * @param rpcType rpcType
- * @param serviceName serviceName
- * @param methodName methodName
- * @param parameterTypes parameterTypes
- * @param rpcExt rpcExt
- * @param enabled enabled
- */
- public MetaData(final String id, final String appName, final String contextPath, final String path, final String rpcType, final String serviceName,
- final String methodName, final String parameterTypes, final String rpcExt, final Boolean enabled) {
- this.id = id;
- this.appName = appName;
- this.contextPath = contextPath;
- this.path = path;
- this.rpcType = rpcType;
- this.serviceName = serviceName;
- this.methodName = methodName;
- this.parameterTypes = parameterTypes;
- this.rpcExt = rpcExt;
- this.enabled = enabled;
- }
-
- /**
- * builder constructor.
- *
- * @param builder builder
- */
- private MetaData(final Builder builder) {
- this.id = builder.id;
- this.appName = builder.appName;
- this.contextPath = builder.contextPath;
- this.path = builder.path;
- this.rpcType = builder.rpcType;
- this.serviceName = builder.serviceName;
- this.methodName = builder.methodName;
- this.parameterTypes = builder.parameterTypes;
- this.rpcExt = builder.rpcExt;
- this.enabled = builder.enabled;
- }
-
- /**
- * class builder.
- *
- * @return Builder
- */
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * get id.
- *
- * @return id
- */
- public String getId() {
- return id;
- }
-
- /**
- * set id.
- *
- * @param id id
- */
- public void setId(final String id) {
- this.id = id;
- }
-
- /**
- * get appName.
- *
- * @return appName
- */
- public String getAppName() {
- return appName;
- }
-
- /**
- * set appName.
- *
- * @param appName appName
- */
- public void setAppName(final String appName) {
- this.appName = appName;
- }
-
- /**
- * get contextPath.
- *
- * @return contextPath
- */
- public String getContextPath() {
- return contextPath;
- }
-
- /**
- * set contextPath.
- *
- * @param contextPath contextPath
- */
- public void setContextPath(final String contextPath) {
- this.contextPath = contextPath;
- }
-
- /**
- * get path.
- *
- * @return path
- */
- public String getPath() {
- return path;
- }
-
- /**
- * set path.
- *
- * @param path path
- */
- public void setPath(final String path) {
- this.path = path;
- }
-
- /**
- * get rpcType.
- *
- * @return rpcType
- */
- public String getRpcType() {
- return rpcType;
- }
-
- /**
- * set rpcType.
- *
- * @param rpcType rpcType
- */
- public void setRpcType(final String rpcType) {
- this.rpcType = rpcType;
- }
-
- /**
- * get serviceName.
- *
- * @return serviceName
- */
- public String getServiceName() {
- return serviceName;
- }
-
- /**
- * set serviceName.
- *
- * @param serviceName serviceName
- */
- public void setServiceName(final String serviceName) {
- this.serviceName = serviceName;
- }
-
- /**
- * get methodName.
- *
- * @return methodName
- */
- public String getMethodName() {
- return methodName;
- }
-
- /**
- * set methodName.
- *
- * @param methodName methodName
- */
- public void setMethodName(final String methodName) {
- this.methodName = methodName;
- }
-
- /**
- * get parameterTypes.
- *
- * @return parameterTypes
- */
- public String getParameterTypes() {
- return parameterTypes;
- }
-
- /**
- * set parameterTypes.
- *
- * @param parameterTypes parameterTypes
- */
- public void setParameterTypes(final String parameterTypes) {
- this.parameterTypes = parameterTypes;
- }
-
- /**
- * get rpcExt.
- *
- * @return rpcExt
- */
- public String getRpcExt() {
- return rpcExt;
- }
-
- /**
- * set rpcExt.
- *
- * @param rpcExt rpcExt
- */
- public void setRpcExt(final String rpcExt) {
- this.rpcExt = rpcExt;
- }
-
- /**
- * get enabled.
- *
- * @return enabled
- */
- public Boolean getEnabled() {
- return enabled;
- }
-
- /**
- * set enabled.
- *
- * @param enabled enabled
- */
- public void setEnabled(final Boolean enabled) {
- this.enabled = enabled;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- MetaData metaData = (MetaData) o;
- return Objects.equals(id, metaData.id) && Objects.equals(appName, metaData.appName) && Objects.equals(contextPath, metaData.contextPath)
- && Objects.equals(path, metaData.path) && Objects.equals(rpcType, metaData.rpcType) && Objects.equals(serviceName, metaData.serviceName)
- && Objects.equals(methodName, metaData.methodName) && Objects.equals(parameterTypes, metaData.parameterTypes)
- && Objects.equals(rpcExt, metaData.rpcExt) && Objects.equals(enabled, metaData.enabled);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, appName, contextPath, path, rpcType, serviceName, methodName, parameterTypes, rpcExt, enabled);
- }
-
- @Override
- public String toString() {
- return "MetaData{"
- + "id='"
- + id
- + '\''
- + ", appName='"
- + appName
- + '\''
- + ", contextPath='"
- + contextPath
- + '\''
- + ", path='"
- + path
- + '\''
- + ", rpcType='"
- + rpcType
- + '\''
- + ", serviceName='"
- + serviceName
- + '\''
- + ", methodName='"
- + methodName
- + '\''
- + ", parameterTypes='"
- + parameterTypes
- + '\''
- + ", rpcExt='"
- + rpcExt
- + '\''
- + ", enabled="
- + enabled
- + '}';
- }
-
- /**
- * update ContextPath.
- */
- public void updateContextPath() {
- if (StringUtils.isNoneBlank(this.path)) {
- this.contextPath = StringUtils.indexOf(path, "/", 1) > -1
- ? this.path.substring(0, StringUtils.indexOf(path, "/", 1)) : path;
- }
- }
-
- /**
- * class builder.
- */
- public static final class Builder {
-
- /**
- * id.
- */
- private String id;
-
- /**
- * appName.
- */
- private String appName;
-
- /**
- * contextPath.
- */
- private String contextPath;
-
- /**
- * path.
- */
- private String path;
-
- /**
- * rpcType.
- */
- private String rpcType;
-
- /**
- * serviceName.
- */
- private String serviceName;
-
- /**
- * methodName.
- */
- private String methodName;
-
- /**
- * parameterTypes.
- */
- private String parameterTypes;
-
- /**
- * rpcExt.
- */
- private String rpcExt;
-
- /**
- * enabled.
- */
- private Boolean enabled;
-
- /**
- * no args constructor.
- */
- private Builder() {
- }
-
- /**
- * build new Object.
- *
- * @return MetaData
- */
- public MetaData build() {
- return new MetaData(this);
- }
-
- /**
- * build id.
- *
- * @param id id
- * @return this
- */
- public Builder id(final String id) {
- this.id = id;
- return this;
- }
-
- /**
- * build appName.
- *
- * @param appName appName
- * @return this
- */
- public Builder appName(final String appName) {
- this.appName = appName;
- return this;
- }
-
- /**
- * build contextPath.
- *
- * @param contextPath contextPath
- * @return this
- */
- public Builder contextPath(final String contextPath) {
- this.contextPath = contextPath;
- return this;
- }
-
- /**
- * build path.
- *
- * @param path path
- * @return this
- */
- public Builder path(final String path) {
- this.path = path;
- return this;
- }
-
- /**
- * build rpcType.
- *
- * @param rpcType rpcType
- * @return this
- */
- public Builder rpcType(final String rpcType) {
- this.rpcType = rpcType;
- return this;
- }
-
- /**
- * build serviceName.
- *
- * @param serviceName serviceName
- * @return this
- */
- public Builder serviceName(final String serviceName) {
- this.serviceName = serviceName;
- return this;
- }
-
- /**
- * build methodName.
- *
- * @param methodName methodName
- * @return this
- */
- public Builder methodName(final String methodName) {
- this.methodName = methodName;
- return this;
- }
-
- /**
- * build parameterTypes.
- *
- * @param parameterTypes parameterTypes
- * @return this
- */
- public Builder parameterTypes(final String parameterTypes) {
- this.parameterTypes = parameterTypes;
- return this;
- }
-
- /**
- * build rpcExt.
- *
- * @param rpcExt rpcExt
- * @return this
- */
- public Builder rpcExt(final String rpcExt) {
- this.rpcExt = rpcExt;
- return this;
- }
-
- /**
- * build enabled.
- *
- * @param enabled enabled
- * @return this
- */
- public Builder enabled(final Boolean enabled) {
- this.enabled = enabled;
- return this;
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/PluginData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/PluginData.java
deleted file mode 100644
index 50ad72b..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/PluginData.java
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import java.util.Objects;
-
-/**
- * PluginData.
- *
- * @since 2.0.0
- */
-public class PluginData {
-
- private String id;
-
- private String name;
-
- private String config;
-
- private String role;
-
- private Boolean enabled;
-
- private Integer sort;
-
- private String pluginJar;
-
- /**
- * no args constructor.
- */
- public PluginData() {
- }
-
- /**
- * all args constructor without sort.
- *
- * @param id id
- * @param name name
- * @param config config
- * @param role role
- * @param enabled enabled
- */
- public PluginData(final String id, final String name, final String config, final String role, final Boolean enabled, final String pluginJar) {
- this.id = id;
- this.name = name;
- this.config = config;
- this.role = role;
- this.enabled = enabled;
- this.pluginJar = pluginJar;
- }
-
- /**
- * all args constructor.
- *
- * @param id id
- * @param name name
- * @param config config
- * @param role role
- * @param enabled enabled
- * @param sort sort
- */
- public PluginData(final String id, final String name, final String config, final String role, final Boolean enabled,
- final Integer sort, final String pluginJar) {
- this.id = id;
- this.name = name;
- this.config = config;
- this.role = role;
- this.enabled = enabled;
- this.sort = sort;
- this.pluginJar = pluginJar;
- }
-
- /**
- * builder constructor.
- *
- * @param builder builder
- */
- private PluginData(final Builder builder) {
- this.id = builder.id;
- this.name = builder.name;
- this.config = builder.config;
- this.role = builder.role;
- this.enabled = builder.enabled;
- this.sort = builder.sort;
- this.pluginJar = builder.pluginJar;
- }
-
- /**
- * class builder.
- *
- * @return Builder
- */
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * get id.
- *
- * @return id
- */
- public String getId() {
- return id;
- }
-
- /**
- * set id.
- *
- * @param id id
- */
- public void setId(final String id) {
- this.id = id;
- }
-
- /**
- * get name.
- *
- * @return name
- */
- public String getName() {
- return name;
- }
-
- /**
- * set name.
- *
- * @param name name
- */
- public void setName(final String name) {
- this.name = name;
- }
-
- /**
- * get config.
- *
- * @return config
- */
- public String getConfig() {
- return config;
- }
-
- /**
- * set config.
- *
- * @param config config
- */
- public void setConfig(final String config) {
- this.config = config;
- }
-
- /**
- * get role.
- *
- * @return role
- */
- public String getRole() {
- return role;
- }
-
- /**
- * set role.
- *
- * @param role role
- */
- public void setRole(final String role) {
- this.role = role;
- }
-
- /**
- * get enabled.
- *
- * @return enabled
- */
- public Boolean getEnabled() {
- return enabled;
- }
-
- /**
- * get pluginJar.
- * @return pluginJar
- */
- public String getPluginJar() {
- return pluginJar;
- }
-
- /**
- * set pluginJar.
- * @param pluginJar pluginJar
- */
- public void setPluginJar(final String pluginJar) {
- this.pluginJar = pluginJar;
- }
-
- /**
- * get sort.
- *
- * @return enabled
- */
- public Integer getSort() {
- return sort;
- }
-
-
- /**
- * set sort.
- *
- * @param sort sort value
- */
- public void setSort(final Integer sort) {
- this.sort = sort;
- }
-
- /**
- * set enabled.
- *
- * @param enabled enabled
- */
- public void setEnabled(final Boolean enabled) {
- this.enabled = enabled;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- PluginData that = (PluginData) o;
- return Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals(config, that.config)
- && Objects.equals(role, that.role) && Objects.equals(enabled, that.enabled);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, name, config, role, enabled);
- }
-
- @Override
- public String toString() {
- return "PluginData{"
- + "id='" + id + '\''
- + ", name='" + name + '\''
- + ", config='" + config + '\''
- + ", role='" + role + '\''
- + ", enabled=" + enabled
- + ", sort=" + sort
- + ", pluginJar=" + pluginJar
- + '}';
- }
-
- /**
- * class builder.
- */
- public static final class Builder {
-
- /**
- * id.
- */
- private String id;
-
- /**
- * name.
- */
- private String name;
-
- /**
- * config.
- */
- private String config;
-
- /**
- * role.
- */
- private String role;
-
- /**
- * enabled.
- */
- private Boolean enabled;
-
- /**
- * sort.
- */
- private Integer sort;
-
- /**
- * sort.
- */
- private String pluginJar;
-
-
- /**
- * no args constructor.
- */
- private Builder() {
- }
-
- /**
- * build new Object.
- *
- * @return PluginData
- */
- public PluginData build() {
- return new PluginData(this);
- }
-
- /**
- * build id.
- *
- * @param id id
- * @return this
- */
- public Builder id(final String id) {
- this.id = id;
- return this;
- }
-
- /**
- * build name.
- *
- * @param name name
- * @return this
- */
- public Builder name(final String name) {
- this.name = name;
- return this;
- }
-
- /**
- * build config.
- *
- * @param config config
- * @return this
- */
- public Builder config(final String config) {
- this.config = config;
- return this;
- }
-
- /**
- * build role.
- *
- * @param role role
- * @return this
- */
- public Builder role(final String role) {
- this.role = role;
- return this;
- }
-
- /**
- * build enabled.
- *
- * @param enabled enabled
- * @return this
- */
- public Builder enabled(final Boolean enabled) {
- this.enabled = enabled;
- return this;
- }
-
- /**
- * build sort.
- *
- * @param sort sort
- * @return this
- */
- public Builder sort(final Integer sort) {
- this.sort = sort;
- return this;
- }
-
-
- /**
- * build pluginJar.
- *
- * @param pluginJar pluginJar
- * @return this
- */
- public Builder pluginJar(final String pluginJar) {
- this.pluginJar = pluginJar;
- return this;
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/ProxySelectorData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/ProxySelectorData.java
deleted file mode 100644
index 0f28eed..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/ProxySelectorData.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import java.util.Properties;
-
-/**
- * ProxySelectorData.
- */
-public class ProxySelectorData {
-
- private String id;
-
- private String name;
-
- private String pluginName;
-
- private String type;
-
- private Integer forwardPort;
-
- private Properties props = new Properties();
-
- /**
- * getId.
- *
- * @return id
- */
- public String getId() {
- return id;
- }
-
- /**
- * setId.
- *
- * @param id id
- */
- public void setId(final String id) {
- this.id = id;
- }
-
- /**
- * getName.
- *
- * @return name
- */
- public String getName() {
- return name;
- }
-
- /**
- * setName.
- *
- * @param name name
- */
- public void setName(final String name) {
- this.name = name;
- }
-
- /**
- * getPluginName.
- *
- * @return pluginName
- */
- public String getPluginName() {
- return pluginName;
- }
-
- /**
- * setPluginName.
- *
- * @param pluginName pluginName
- */
- public void setPluginName(final String pluginName) {
- this.pluginName = pluginName;
- }
-
- /**
- * getType.
- *
- * @return type
- */
- public String getType() {
- return type;
- }
-
- /**
- * setType.
- *
- * @param type type
- */
- public void setType(final String type) {
- this.type = type;
- }
-
- /**
- * getForwardPort.
- *
- * @return forwardPort
- */
- public Integer getForwardPort() {
- return forwardPort;
- }
-
- /**
- * setForwardPort.
- *
- * @param forwardPort forwardPort
- */
- public void setForwardPort(final Integer forwardPort) {
- this.forwardPort = forwardPort;
- }
-
- /**
- * getProps.
- *
- * @return props
- */
- public Properties getProps() {
- return props;
- }
-
- /**
- * setProps.
- *
- * @param props props
- */
- public void setProps(final Properties props) {
- this.props = props;
- }
-
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/RuleData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/RuleData.java
deleted file mode 100644
index 4e8ffae..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/RuleData.java
+++ /dev/null
@@ -1,572 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import java.util.List;
-import java.util.Objects;
-
-/**
- * RuleData.
- *
- * @since 2.0.0
- */
-public class RuleData {
-
- private String id;
-
- private String name;
-
- private String pluginName;
-
- private String selectorId;
-
- /**
- * match way(0 and 1 or).
- */
- private Integer matchMode;
-
- private Integer sort;
-
- private Boolean enabled;
-
- private Boolean loged;
-
- /**
- * handle message(different plugin have different handle to mark ,json style).
- */
- private String handle;
-
- private List conditionDataList;
-
- private List beforeConditionDataList;
-
- /**
- * match restful.
- */
- private Boolean matchRestful;
-
- /**
- * no args constructor.
- */
- public RuleData() {
- }
-
- /**
- * builder constructor.
- *
- * @param builder builder
- */
- private RuleData(final Builder builder) {
- this.id = builder.id;
- this.name = builder.name;
- this.pluginName = builder.pluginName;
- this.selectorId = builder.selectorId;
- this.matchMode = builder.matchMode;
- this.sort = builder.sort;
- this.enabled = builder.enabled;
- this.loged = builder.loged;
- this.handle = builder.handle;
- this.conditionDataList = builder.conditionDataList;
- this.beforeConditionDataList = builder.beforeConditionDataList;
- this.matchRestful = builder.matchRestful;
- }
-
- /**
- * class builder.
- *
- * @return Builder
- */
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * get id.
- *
- * @return id
- */
- public String getId() {
- return id;
- }
-
- /**
- * set id.
- *
- * @param id id
- * @return this
- */
- public RuleData setId(final String id) {
- this.id = id;
- return this;
- }
-
- /**
- * get name.
- *
- * @return name
- */
- public String getName() {
- return name;
- }
-
- /**
- * set name.
- *
- * @param name name
- * @return this
- */
- public RuleData setName(final String name) {
- this.name = name;
- return this;
- }
-
- /**
- * get pluginName.
- *
- * @return pluginName
- */
- public String getPluginName() {
- return pluginName;
- }
-
- /**
- * set pluginName.
- *
- * @param pluginName pluginName
- * @return this
- */
- public RuleData setPluginName(final String pluginName) {
- this.pluginName = pluginName;
- return this;
- }
-
- /**
- * get selectorId.
- *
- * @return selectorId
- */
- public String getSelectorId() {
- return selectorId;
- }
-
- /**
- * set selectorId.
- *
- * @param selectorId selectorId
- * @return this
- */
- public RuleData setSelectorId(final String selectorId) {
- this.selectorId = selectorId;
- return this;
- }
-
- /**
- * get matchMode.
- *
- * @return matchMode
- */
- public Integer getMatchMode() {
- return matchMode;
- }
-
- /**
- * set matchMode.
- *
- * @param matchMode matchMode
- * @return this
- */
- public RuleData setMatchMode(final Integer matchMode) {
- this.matchMode = matchMode;
- return this;
- }
-
- /**
- * get sort.
- *
- * @return sort
- */
- public Integer getSort() {
- return sort;
- }
-
- /**
- * set sort.
- *
- * @param sort sort
- * @return this
- */
- public RuleData setSort(final Integer sort) {
- this.sort = sort;
- return this;
- }
-
- /**
- * get enabled.
- *
- * @return enabled
- */
- public Boolean getEnabled() {
- return enabled;
- }
-
- /**
- * set enabled.
- *
- * @param enabled enabled
- * @return this
- */
- public RuleData setEnabled(final Boolean enabled) {
- this.enabled = enabled;
- return this;
- }
-
- /**
- * get loged.
- *
- * @return loged
- */
- public Boolean getLoged() {
- return loged;
- }
-
- /**
- * set loged.
- *
- * @param loged loged
- * @return this
- */
- public RuleData setLoged(final Boolean loged) {
- this.loged = loged;
- return this;
- }
-
- /**
- * get handle.
- *
- * @return handle
- */
- public String getHandle() {
- return handle;
- }
-
- /**
- * set handle.
- *
- * @param handle handle
- * @return this
- */
- public RuleData setHandle(final String handle) {
- this.handle = handle;
- return this;
- }
-
- /**
- * get conditionDataList.
- *
- * @return conditionDataList
- */
- public List getConditionDataList() {
- return conditionDataList;
- }
-
- /**
- * set conditionDataList.
- *
- * @param conditionDataList conditionDataList
- * @return this
- */
- public RuleData setConditionDataList(final List conditionDataList) {
- this.conditionDataList = conditionDataList;
- return this;
- }
-
- /**
- * get beforeConditionDataList.
- *
- * @return beforeConditionDataList
- */
- public List getBeforeConditionDataList() {
- return beforeConditionDataList;
- }
-
- /**
- * set beforeConditionDataList.
- *
- * @param beforeConditionDataList beforeConditionDataList
- */
- public void setBeforeConditionDataList(final List beforeConditionDataList) {
- this.beforeConditionDataList = beforeConditionDataList;
- }
-
- /**
- * get match restful.
- *
- * @return matchRestful
- */
- public Boolean getMatchRestful() {
- return matchRestful;
- }
-
- /**
- * set match restful.
- *
- * @param matchRestful matchRestful
- */
- public void setMatchRestful(final Boolean matchRestful) {
- this.matchRestful = matchRestful;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- final RuleData ruleData = (RuleData) o;
- return Objects.equals(id, ruleData.id)
- && Objects.equals(name, ruleData.name)
- && Objects.equals(pluginName, ruleData.pluginName)
- && Objects.equals(selectorId, ruleData.selectorId)
- && Objects.equals(matchMode, ruleData.matchMode)
- && Objects.equals(sort, ruleData.sort)
- && Objects.equals(enabled, ruleData.enabled)
- && Objects.equals(loged, ruleData.loged)
- && Objects.equals(handle, ruleData.handle)
- && Objects.equals(conditionDataList, ruleData.conditionDataList)
- && Objects.equals(beforeConditionDataList, ruleData.beforeConditionDataList)
- && Objects.equals(matchRestful, ruleData.matchRestful);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, name, pluginName, selectorId, matchMode, sort, enabled, loged, handle, conditionDataList,
- beforeConditionDataList, matchRestful);
- }
-
- @Override
- public String toString() {
- return "RuleData{"
- + "id='"
- + id
- + '\''
- + ", name='"
- + name
- + '\''
- + ", pluginName='"
- + pluginName
- + '\''
- + ", selectorId='"
- + selectorId
- + '\''
- + ", matchMode="
- + matchMode
- + ", sort="
- + sort
- + ", enabled="
- + enabled
- + ", loged="
- + loged
- + ", handle='"
- + handle
- + '\''
- + ", conditionDataList="
- + conditionDataList
- + ", matchRestful="
- + matchRestful
- + '}';
- }
-
- /**
- * class builder.
- */
- public static final class Builder {
-
- private String id;
-
- private String name;
-
- private String pluginName;
-
- private String selectorId;
-
- private Integer matchMode;
-
- private Integer sort;
-
- private Boolean enabled;
-
- private Boolean loged;
-
- private String handle;
-
- private List conditionDataList;
-
- private List beforeConditionDataList;
-
- private Boolean matchRestful;
-
- /**
- * no args constructor.
- */
- private Builder() {
- }
-
- /**
- * build new Object.
- *
- * @return RuleData
- */
- public RuleData build() {
- return new RuleData(this);
- }
-
- /**
- * build id.
- *
- * @param id id
- * @return this
- */
- public Builder id(final String id) {
- this.id = id;
- return this;
- }
-
- /**
- * build name.
- *
- * @param name name
- * @return this
- */
- public Builder name(final String name) {
- this.name = name;
- return this;
- }
-
- /**
- * build pluginName.
- *
- * @param pluginName pluginName
- * @return this
- */
- public Builder pluginName(final String pluginName) {
- this.pluginName = pluginName;
- return this;
- }
-
- /**
- * build selectorId.
- *
- * @param selectorId selectorId
- * @return this
- */
- public Builder selectorId(final String selectorId) {
- this.selectorId = selectorId;
- return this;
- }
-
- /**
- * build matchMode.
- *
- * @param matchMode matchMode
- * @return this
- */
- public Builder matchMode(final Integer matchMode) {
- this.matchMode = matchMode;
- return this;
- }
-
- /**
- * build sort.
- *
- * @param sort sort
- * @return this
- */
- public Builder sort(final Integer sort) {
- this.sort = sort;
- return this;
- }
-
- /**
- * build enabled.
- *
- * @param enabled enabled
- * @return this
- */
- public Builder enabled(final Boolean enabled) {
- this.enabled = enabled;
- return this;
- }
-
- /**
- * build loged.
- *
- * @param loged loged
- * @return this
- */
- public Builder loged(final Boolean loged) {
- this.loged = loged;
- return this;
- }
-
- /**
- * build handle.
- *
- * @param handle handle
- * @return this
- */
- public Builder handle(final String handle) {
- this.handle = handle;
- return this;
- }
-
- /**
- * build conditionDataList.
- *
- * @param conditionDataList conditionDataList
- * @return this
- */
- public Builder conditionDataList(final List conditionDataList) {
- this.conditionDataList = conditionDataList;
- return this;
- }
-
- /**
- * build conditionDataList.
- *
- * @param beforeConditionDataList beforeConditionDataList
- * @return this
- */
- public Builder beforeConditionDataList(final List beforeConditionDataList) {
- this.beforeConditionDataList = beforeConditionDataList;
- return this;
- }
-
- /**
- * build match restful.
- *
- * @param matchRestful matchRestful
- * @return this
- */
- public Builder matchRestful(final Boolean matchRestful) {
- this.matchRestful = matchRestful;
- return this;
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/SelectorData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/SelectorData.java
deleted file mode 100644
index 9597c11..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/SelectorData.java
+++ /dev/null
@@ -1,623 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import java.util.List;
-import java.util.Objects;
-
-/**
- * SelectorData.
- *
- * @since 2.0.0
- */
-public class SelectorData {
-
- private String id;
-
- private String pluginId;
-
- /**
- * plugin name.
- */
- private String pluginName;
-
- private String name;
-
- /**
- * matchMode(0 and 1 or).
- */
- private Integer matchMode;
-
- /**
- * type(false full,true custom).
- */
- private Integer type;
-
- private Integer sort;
-
- private Boolean enabled;
-
- private Boolean logged;
-
- private Boolean continued = Boolean.TRUE;
-
- private String handle;
-
- private List conditionList;
-
- private List beforeConditionList;
-
- /**
- * match restful api.
- */
- private Boolean matchRestful;
-
- /**
- * no args constructor.
- */
- public SelectorData() {
- }
-
- /**
- * builder constructor.
- *
- * @param builder builder
- */
- private SelectorData(final Builder builder) {
- this.id = builder.id;
- this.pluginId = builder.pluginId;
- this.pluginName = builder.pluginName;
- this.name = builder.name;
- this.matchMode = builder.matchMode;
- this.type = builder.type;
- this.sort = builder.sort;
- this.enabled = builder.enabled;
- this.logged = builder.logged;
- this.continued = builder.continued;
- this.handle = builder.handle;
- this.conditionList = builder.conditionList;
- this.matchRestful = builder.matchRestful;
- this.beforeConditionList = builder.beforeConditionList;
- }
-
- /**
- * class builder.
- *
- * @return Builder
- */
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * get id.
- *
- * @return id
- */
- public String getId() {
- return id;
- }
-
- /**
- * set id.
- *
- * @param id id
- */
- public void setId(final String id) {
- this.id = id;
- }
-
- /**
- * get pluginId.
- *
- * @return pluginId
- */
- public String getPluginId() {
- return pluginId;
- }
-
- /**
- * set pluginId.
- *
- * @param pluginId pluginId
- */
- public void setPluginId(final String pluginId) {
- this.pluginId = pluginId;
- }
-
- /**
- * get pluginName.
- *
- * @return pluginName
- */
- public String getPluginName() {
- return pluginName;
- }
-
- /**
- * set pluginName.
- *
- * @param pluginName pluginName
- */
- public void setPluginName(final String pluginName) {
- this.pluginName = pluginName;
- }
-
- /**
- * get name.
- *
- * @return name
- */
- public String getName() {
- return name;
- }
-
- /**
- * set name.
- *
- * @param name name
- */
- public void setName(final String name) {
- this.name = name;
- }
-
- /**
- * get matchMode.
- *
- * @return matchMode
- */
- public Integer getMatchMode() {
- return matchMode;
- }
-
- /**
- * set matchMode.
- *
- * @param matchMode matchMode
- */
- public void setMatchMode(final Integer matchMode) {
- this.matchMode = matchMode;
- }
-
- /**
- * get type.
- *
- * @return type
- */
- public Integer getType() {
- return type;
- }
-
- /**
- * set type.
- *
- * @param type type
- */
- public void setType(final Integer type) {
- this.type = type;
- }
-
- /**
- * get sort.
- *
- * @return sort
- */
- public Integer getSort() {
- return sort;
- }
-
- /**
- * set sort.
- *
- * @param sort sort
- */
- public void setSort(final Integer sort) {
- this.sort = sort;
- }
-
- /**
- * get enabled.
- *
- * @return enabled
- */
- public Boolean getEnabled() {
- return enabled;
- }
-
- /**
- * set enabled.
- *
- * @param enabled enabled
- */
- public void setEnabled(final Boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * get logged.
- *
- * @return logged
- */
- public Boolean getLogged() {
- return logged;
- }
-
- /**
- * set logged.
- *
- * @param logged logged
- */
- public void setLogged(final Boolean logged) {
- this.logged = logged;
- }
-
- /**
- * get continued.
- *
- * @return continued
- */
- public Boolean getContinued() {
- if (Objects.isNull(continued)) {
- return true;
- }
- return continued;
- }
-
- /**
- * set continued.
- *
- * @param continued continued
- */
- public void setContinued(final Boolean continued) {
- this.continued = continued;
- }
-
- /**
- * get handle.
- *
- * @return handle
- */
- public String getHandle() {
- return handle;
- }
-
- /**
- * set handle.
- *
- * @param handle handle
- */
- public void setHandle(final String handle) {
- this.handle = handle;
- }
-
- /**
- * get conditionList.
- *
- * @return conditionList
- */
- public List getConditionList() {
- return conditionList;
- }
-
- /**
- * set conditionList.
- *
- * @param conditionList conditionList
- */
- public void setConditionList(final List conditionList) {
- this.conditionList = conditionList;
- }
-
- /**
- * get match restful.
- *
- * @return match restful
- */
- public Boolean getMatchRestful() {
- return matchRestful;
- }
-
- /**
- * set match restful.
- *
- * @param matchRestful matchRestful
- */
- public void setMatchRestful(final Boolean matchRestful) {
- this.matchRestful = matchRestful;
- }
-
- /**
- * get before condition list.
- *
- * @return before condition list
- */
- public List getBeforeConditionList() {
- return beforeConditionList;
- }
-
- /**
- * set before condition list.
- *
- * @param beforeConditionList before condition list
- */
- public void setBeforeConditionList(final List beforeConditionList) {
- this.beforeConditionList = beforeConditionList;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- SelectorData that = (SelectorData) o;
- return Objects.equals(id, that.id) && Objects.equals(pluginId, that.pluginId) && Objects.equals(pluginName, that.pluginName)
- && Objects.equals(name, that.name) && Objects.equals(matchMode, that.matchMode) && Objects.equals(type, that.type)
- && Objects.equals(sort, that.sort) && Objects.equals(enabled, that.enabled) && Objects.equals(logged, that.logged)
- && Objects.equals(continued, that.continued) && Objects.equals(handle, that.handle)
- && Objects.equals(conditionList, that.conditionList) && Objects.equals(matchRestful, that.matchRestful)
- && Objects.equals(beforeConditionList, that.beforeConditionList);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, pluginId, pluginName, name, matchMode, type, sort, enabled, logged, continued, handle, conditionList, matchRestful, beforeConditionList);
- }
-
- @Override
- public String toString() {
- return "SelectorData{"
- + "id='"
- + id
- + '\''
- + ", pluginId='"
- + pluginId
- + '\''
- + ", pluginName='"
- + pluginName
- + '\''
- + ", name='"
- + name
- + '\''
- + ", matchMode="
- + matchMode
- + ", type="
- + type
- + ", sort="
- + sort
- + ", enabled="
- + enabled
- + ", logged="
- + logged
- + ", continued="
- + continued
- + ", handle='"
- + handle
- + '\''
- + ", conditionList="
- + conditionList
- + ", matchRestful="
- + matchRestful
- + '}';
- }
-
- /**
- * class builder.
- */
- public static final class Builder {
-
- private String id;
-
- private String pluginId;
-
- private String pluginName;
-
- private String name;
-
- private Integer matchMode;
-
- private Integer type;
-
- private Integer sort;
-
- private Boolean enabled;
-
- private Boolean logged;
-
- private Boolean continued;
-
- private String handle;
-
- private List conditionList;
-
- private Boolean matchRestful;
-
- private List beforeConditionList;
-
- /**
- * no args constructor.
- */
- private Builder() {
- }
-
- /**
- * build new Object.
- *
- * @return SelectorData
- */
- public SelectorData build() {
- return new SelectorData(this);
- }
-
- /**
- * build id.
- *
- * @param id id
- * @return this
- */
- public Builder id(final String id) {
- this.id = id;
- return this;
- }
-
- /**
- * build pluginId.
- *
- * @param pluginId pluginId
- * @return this
- */
- public Builder pluginId(final String pluginId) {
- this.pluginId = pluginId;
- return this;
- }
-
- /**
- * build pluginName.
- *
- * @param pluginName pluginName
- * @return this
- */
- public Builder pluginName(final String pluginName) {
- this.pluginName = pluginName;
- return this;
- }
-
- /**
- * build name.
- *
- * @param name name
- * @return this
- */
- public Builder name(final String name) {
- this.name = name;
- return this;
- }
-
- /**
- * build matchMode.
- *
- * @param matchMode matchMode
- * @return this
- */
- public Builder matchMode(final Integer matchMode) {
- this.matchMode = matchMode;
- return this;
- }
-
- /**
- * build type.
- *
- * @param type type
- * @return this
- */
- public Builder type(final Integer type) {
- this.type = type;
- return this;
- }
-
- /**
- * build sort.
- *
- * @param sort sort
- * @return this
- */
- public Builder sort(final Integer sort) {
- this.sort = sort;
- return this;
- }
-
- /**
- * build enabled.
- *
- * @param enabled enabled
- * @return this
- */
- public Builder enabled(final Boolean enabled) {
- this.enabled = enabled;
- return this;
- }
-
- /**
- * build logged.
- *
- * @param logged logged
- * @return this
- */
- public Builder logged(final Boolean logged) {
- this.logged = logged;
- return this;
- }
-
- /**
- * build continued.
- *
- * @param continued continued
- * @return this
- */
- public Builder continued(final Boolean continued) {
- this.continued = continued;
- return this;
- }
-
- /**
- * build handle.
- *
- * @param handle handle
- * @return this
- */
- public Builder handle(final String handle) {
- this.handle = handle;
- return this;
- }
-
- /**
- * build conditionList.
- *
- * @param conditionList conditionList
- * @return this
- */
- public Builder conditionList(final List conditionList) {
- this.conditionList = conditionList;
- return this;
- }
-
- /**
- * build match restful.
- *
- * @param matchRestful matchRestful
- * @return this
- */
- public Builder matchRestful(final Boolean matchRestful) {
- this.matchRestful = matchRestful;
- return this;
- }
-
- /**
- * build beforeConditionList.
- *
- * @param beforeConditionList beforeConditionList
- * @return this
- */
- public Builder beforeConditionList(final List beforeConditionList) {
- this.beforeConditionList = beforeConditionList;
- return this;
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/WebsocketData.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/WebsocketData.java
deleted file mode 100644
index beb690c..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/WebsocketData.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto;
-
-import org.apache.shenyu.common.enums.ConfigGroupEnum;
-import org.apache.shenyu.common.enums.DataEventTypeEnum;
-
-import java.util.List;
-import java.util.Objects;
-
-/**
- * Data set, including {@link AppAuthData}、{@link ConditionData}、{@link PluginData}、{@link RuleData}、{@link SelectorData}.
- *
- * @param the type parameter
- * @since 2.0.0
- */
-public class WebsocketData {
-
- /**
- * group type.
- * {@linkplain ConfigGroupEnum}
- */
- private String groupType;
-
- /**
- * event type.
- * {@linkplain DataEventTypeEnum}
- */
- private String eventType;
-
- /**
- * data list.
- * {@link AppAuthData}、{@link ConditionData}、{@link PluginData}、{@link RuleData}、{@link SelectorData}.
- */
- private List data;
-
- /**
- * no args constructor.
- */
- public WebsocketData() {
- }
-
- /**
- * all args constructor.
- *
- * @param groupType groupType
- * @param eventType eventType
- * @param data data
- */
- public WebsocketData(final String groupType, final String eventType, final List data) {
- this.groupType = groupType;
- this.eventType = eventType;
- this.data = data;
- }
-
- /**
- * get groupType.
- *
- * @return groupType
- */
- public String getGroupType() {
- return groupType;
- }
-
- /**
- * set groupType.
- *
- * @param groupType groupType
- * @return this
- */
- public WebsocketData setGroupType(final String groupType) {
- this.groupType = groupType;
- return this;
- }
-
- /**
- * get eventType.
- *
- * @return eventType
- */
- public String getEventType() {
- return eventType;
- }
-
- /**
- * set eventType.
- *
- * @param eventType eventType
- * @return this
- */
- public WebsocketData setEventType(final String eventType) {
- this.eventType = eventType;
- return this;
- }
-
- /**
- * get data.
- *
- * @return data
- */
- public List getData() {
- return data;
- }
-
- /**
- * set data.
- *
- * @param data data
- * @return this
- */
- public WebsocketData setData(final List data) {
- this.data = data;
- return this;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- WebsocketData> that = (WebsocketData>) o;
- return Objects.equals(groupType, that.groupType) && Objects.equals(eventType, that.eventType) && Objects.equals(data, that.data);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(groupType, eventType, data);
- }
-
- @Override
- public String toString() {
- return "WebsocketData{"
- + "groupType='"
- + groupType
- + '\''
- + ", eventType='"
- + eventType
- + '\''
- + ", data="
- + data
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/DubboRegisterConfig.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/DubboRegisterConfig.java
deleted file mode 100644
index 06eb25d..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/DubboRegisterConfig.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.plugin;
-
-import java.io.Serializable;
-import java.util.Objects;
-
-/**
- * The type dubbo register config.
- */
-public class DubboRegisterConfig implements Serializable {
-
- private static final long serialVersionUID = -4156204056244019979L;
-
- private String register;
-
- private String group;
-
- private String protocol;
-
- private String threadpool;
-
- private Integer corethreads;
-
- private Integer threads;
-
- private Integer queues;
-
- /**
- * get register.
- *
- * @return register
- */
- public String getRegister() {
- return register;
- }
-
- /**
- * set register.
- *
- * @param register register
- */
- public void setRegister(final String register) {
- this.register = register;
- }
-
- /**
- * get group.
- *
- * @return group
- */
- public String getGroup() {
- return group;
- }
-
- /**
- * set group.
- *
- * @param group group
- */
- public void setGroup(final String group) {
- this.group = group;
- }
-
- /**
- * get protocol.
- *
- * @return protocol
- */
- public String getProtocol() {
- return protocol;
- }
-
- /**
- * set protocol.
- *
- * @param protocol protocol
- */
- public void setProtocol(final String protocol) {
- this.protocol = protocol;
- }
-
- /**
- * get threadpool.
- *
- * @return threadpool
- */
- public String getThreadpool() {
- return threadpool;
- }
-
- /**
- * set threadpool.
- *
- * @param threadpool threadpool
- */
- public void setThreadpool(final String threadpool) {
- this.threadpool = threadpool;
- }
-
- /**
- * get corethreads.
- *
- * @return corethreads
- */
- public Integer getCorethreads() {
- return corethreads;
- }
-
- /**
- * set corethreads.
- *
- * @param corethreads corethreads
- */
- public void setCorethreads(final Integer corethreads) {
- this.corethreads = corethreads;
- }
-
- /**
- * get threads.
- *
- * @return threads
- */
- public Integer getThreads() {
- return threads;
- }
-
- /**
- * set threads.
- *
- * @param threads threads
- */
- public void setThreads(final Integer threads) {
- this.threads = threads;
- }
-
- /**
- * get queues.
- *
- * @return queues
- */
- public Integer getQueues() {
- return queues;
- }
-
- /**
- * set queues.
- *
- * @param queues queues
- */
- public void setQueues(final Integer queues) {
- this.queues = queues;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- DubboRegisterConfig that = (DubboRegisterConfig) o;
- return Objects.equals(register, that.register) && Objects.equals(group, that.group) && Objects.equals(protocol, that.protocol)
- && Objects.equals(threadpool, that.threadpool) && Objects.equals(corethreads, that.corethreads) && Objects.equals(threads, that.threads)
- && Objects.equals(queues, that.queues);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(register, group, protocol, threadpool, corethreads, threads, queues);
- }
-
- @Override
- public String toString() {
- return "DubboRegisterConfig{"
- + "register='"
- + register
- + '\''
- + ", group='"
- + group
- + '\''
- + ", protocol='"
- + protocol
- + '\''
- + ", threadpool='"
- + threadpool
- + '\''
- + ", corethreads='"
- + corethreads
- + '\''
- + ", threads='"
- + threads
- + '\''
- + ", queues='"
- + queues
- + '\''
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/GrpcRegisterConfig.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/GrpcRegisterConfig.java
deleted file mode 100644
index 7ca6a41..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/GrpcRegisterConfig.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.plugin;
-
-import java.io.Serializable;
-import java.util.Objects;
-
-/**
- * The type grpc register config.
- */
-public class GrpcRegisterConfig implements Serializable {
-
- private static final long serialVersionUID = -4496044027526152878L;
-
- private String threadpool;
-
- /**
- * get threadpool.
- *
- * @return threadpool
- */
- public String getThreadpool() {
- return threadpool;
- }
-
- /**
- * set threadpool.
- *
- * @param threadpool threadpool
- */
- public void setThreadpool(final String threadpool) {
- this.threadpool = threadpool;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- GrpcRegisterConfig that = (GrpcRegisterConfig) o;
- return Objects.equals(threadpool, that.threadpool);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(threadpool);
- }
-
- @Override
- public String toString() {
- return "GrpcRegisterConfig{"
- + "threadpool='"
- + threadpool
- + '\''
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/MotanRegisterConfig.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/MotanRegisterConfig.java
deleted file mode 100644
index ead3bf7..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/MotanRegisterConfig.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.plugin;
-
-import java.io.Serializable;
-import java.util.Objects;
-
-/**
- * The type motan register config.
- */
-public class MotanRegisterConfig implements Serializable {
-
- private static final long serialVersionUID = 2488053756247710408L;
-
- private String registerProtocol;
-
- private String registerAddress;
-
- private String threadpool;
-
- private Integer corethreads;
-
- private Integer threads;
-
- private Integer queues;
-
- /**
- * get threadpool.
- *
- * @return threadpool
- */
- public String getThreadpool() {
- return threadpool;
- }
-
- /**
- * set threadpool.
- *
- * @param threadpool threadpool
- */
- public void setThreadpool(final String threadpool) {
- this.threadpool = threadpool;
- }
-
-
- /**
- * get corethreads.
- *
- * @return corethreads
- */
- public Integer getCorethreads() {
- return corethreads;
- }
-
- /**
- * set corethreads.
- *
- * @param corethreads corethreads
- */
- public void setCorethreads(final Integer corethreads) {
- this.corethreads = corethreads;
- }
-
- /**
- * get threads.
- *
- * @return threads threads
- */
- public Integer getThreads() {
- return threads;
- }
-
- /**
- * set threads.
- *
- * @param threads threads
- */
- public void setThreads(final Integer threads) {
- this.threads = threads;
- }
-
- /**
- * get queues.
- *
- * @return queues
- */
- public Integer getQueues() {
- return queues;
- }
-
- /**
- * set queues.
- *
- * @param queues queues
- */
- public void setQueues(final Integer queues) {
- this.queues = queues;
- }
-
- /**
- * get RegisterProtocol.
- *
- * @return registerProtocol
- */
- public String getRegisterProtocol() {
- return registerProtocol;
- }
-
- /**
- * set registerProtocol.
- *
- * @param registerProtocol registerProtocol
- */
- public void setRegisterProtocol(final String registerProtocol) {
- this.registerProtocol = registerProtocol;
- }
-
- /**
- * get RegisterAddress.
- *
- * @return registerAddress
- */
- public String getRegisterAddress() {
- return registerAddress;
- }
-
- /**
- * set RegisterAddress.
- *
- * @param registerAddress registerAddress
- */
- public void setRegisterAddress(final String registerAddress) {
- this.registerAddress = registerAddress;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- MotanRegisterConfig that = (MotanRegisterConfig) o;
- return Objects.equals(registerProtocol, that.registerProtocol) && Objects.equals(registerAddress, that.registerAddress) && Objects.equals(threadpool, that.threadpool)
- && Objects.equals(corethreads, that.corethreads) && Objects.equals(threads, that.threads)
- && Objects.equals(queues, that.queues);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(registerProtocol, registerAddress, threadpool, corethreads, threads, queues);
- }
-
- @Override
- public String toString() {
- return "MotanRegisterConfig{"
- + "registerProtocol='"
- + registerProtocol
- + '\''
- + ", registerAddress='"
- + registerAddress
- + '\''
- + ", threadpool='"
- + threadpool
- + '\''
- + ", corethreads='"
- + corethreads
- + '\''
- + ", threads='"
- + threads
- + '\''
- + ", queues='"
- + queues
- + '\''
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/SofaRegisterConfig.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/SofaRegisterConfig.java
deleted file mode 100644
index 38916ea..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/SofaRegisterConfig.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.plugin;
-
-import java.io.Serializable;
-import java.util.Objects;
-
-/**
- * The type sofa register config.
- */
-public class SofaRegisterConfig implements Serializable {
-
- private static final long serialVersionUID = -3770114790533455035L;
-
- private String register;
-
- private String group;
-
- private String protocol;
-
- private String threadpool;
-
- private Integer corethreads;
-
- private Integer threads;
-
- private Integer queues;
-
- /**
- * get register.
- *
- * @return register
- */
- public String getRegister() {
- return register;
- }
-
- /**
- * set register.
- *
- * @param register register
- */
- public void setRegister(final String register) {
- this.register = register;
- }
-
- /**
- * get group.
- *
- * @return group
- */
- public String getGroup() {
- return group;
- }
-
- /**
- * set group.
- *
- * @param group group
- */
- public void setGroup(final String group) {
- this.group = group;
- }
-
- /**
- * get protocol.
- *
- * @return protocol
- */
- public String getProtocol() {
- return protocol;
- }
-
- /**
- * set protocol.
- *
- * @param protocol protocol
- */
- public void setProtocol(final String protocol) {
- this.protocol = protocol;
- }
-
- /**
- * get threadpool.
- *
- * @return threadpool
- */
- public String getThreadpool() {
- return threadpool;
- }
-
- /**
- * set threadpool.
- *
- * @param threadpool threadpool
- */
- public void setThreadpool(final String threadpool) {
- this.threadpool = threadpool;
- }
-
- /**
- * get corethreads.
- *
- * @return corethreads
- */
- public Integer getCorethreads() {
- return corethreads;
- }
-
- /**
- * set corethreads.
- *
- * @param corethreads corethreads
- */
- public void setCorethreads(final Integer corethreads) {
- this.corethreads = corethreads;
- }
-
- /**
- * get threads.
- *
- * @return threads
- */
- public Integer getThreads() {
- return threads;
- }
-
- /**
- * set threads.
- *
- * @param threads threads
- */
- public void setThreads(final Integer threads) {
- this.threads = threads;
- }
-
- /**
- * get queues.
- *
- * @return queues
- */
- public Integer getQueues() {
- return queues;
- }
-
- /**
- * set queues.
- *
- * @param queues queues
- */
- public void setQueues(final Integer queues) {
- this.queues = queues;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- SofaRegisterConfig that = (SofaRegisterConfig) o;
- return Objects.equals(register, that.register) && Objects.equals(group, that.group)
- && Objects.equals(protocol, that.protocol) && Objects.equals(threadpool, that.threadpool)
- && Objects.equals(corethreads, that.corethreads) && Objects.equals(threads, that.threads)
- && Objects.equals(queues, that.queues);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(register, group, protocol, threadpool, corethreads, threads, queues);
- }
-
- @Override
- public String toString() {
- return "SofaRegisterConfig{"
- + "register='"
- + register
- + '\''
- + ", group='"
- + group
- + '\''
- + ", protocol='"
- + protocol
- + '\''
- + ", threadpool='"
- + threadpool
- + '\''
- + ", corethreads='"
- + corethreads
- + '\''
- + ", threads='"
- + threads
- + '\''
- + ", queues='"
- + queues
- + '\''
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/TarsRegisterConfig.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/TarsRegisterConfig.java
deleted file mode 100644
index 4b29654..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/plugin/TarsRegisterConfig.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.plugin;
-
-import java.io.Serializable;
-import java.util.Objects;
-
-/**
- * The type tars register config.
- */
-public class TarsRegisterConfig implements Serializable {
-
- private static final long serialVersionUID = -1124348422759120146L;
-
- private String threadpool;
-
- private Integer corethreads;
-
- private Integer threads;
-
- private Integer queues;
-
- /**
- * get threadpool.
- *
- * @return threadpool
- */
- public String getThreadpool() {
- return threadpool;
- }
-
- /**
- * set threadpool.
- *
- * @param threadpool threadpool
- */
- public void setThreadpool(final String threadpool) {
- this.threadpool = threadpool;
- }
-
- /**
- * get corethreads.
- *
- * @return corethreads
- */
- public Integer getCorethreads() {
- return corethreads;
- }
-
- /**
- * set corethreads.
- *
- * @param corethreads corethreads
- */
- public void setCorethreads(final Integer corethreads) {
- this.corethreads = corethreads;
- }
-
- /**
- * get threads.
- *
- * @return threads
- */
- public Integer getThreads() {
- return threads;
- }
-
- /**
- * set threads.
- *
- * @param threads threads
- */
- public void setThreads(final Integer threads) {
- this.threads = threads;
- }
-
- /**
- * get queues.
- *
- * @return queues
- */
- public Integer getQueues() {
- return queues;
- }
-
- /**
- * set queues.
- *
- * @param queues queues
- */
- public void setQueues(final Integer queues) {
- this.queues = queues;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- TarsRegisterConfig that = (TarsRegisterConfig) o;
- return Objects.equals(threadpool, that.threadpool) && Objects.equals(corethreads, that.corethreads)
- && Objects.equals(threads, that.threads) && Objects.equals(queues, that.queues);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(threadpool, corethreads, threads, queues);
- }
-
- @Override
- public String toString() {
- return "TarsRegisterConfig{"
- + "threadpool='"
- + threadpool
- + '\''
- + ", corethreads='"
- + corethreads
- + '\''
- + ", threads='"
- + threads
- + '\''
- + ", queues='"
- + queues
- + '\''
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/GeneralContextHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/GeneralContextHandle.java
deleted file mode 100644
index a95e331..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/GeneralContextHandle.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule;
-
-import java.util.Objects;
-
-/**
- * this is RequestHandle plugin handle.
- */
-public class GeneralContextHandle {
- /**
- * general context type.
- */
- private String generalContextType;
-
- /**
- * generalContextKey.
- *
- * need to be added new context value.
- * key: new general context key, value: general context value.
- *
- */
- private String generalContextKey;
-
- /**
- * generalContextValue.
- * when generalContextType is addGeneralContext, the generalContextValue is the value of generalContextKey.
- * when generalContextType is transmitHeaderToGeneralContext, the generalContextValue is the new key of generalContext.
- * In this case, if generalContextValue is blank, default value is same as generalContextKey.
- */
- private String generalContextValue;
-
- /**
- * no args constructor.
- */
- public GeneralContextHandle() {
- }
-
- /**
- * all args constructor.
- *
- * @param generalContextType generalContextType
- * @param generalContextKey generalContextKey
- * @param generalContextValue generalContextValue
- */
- public GeneralContextHandle(final String generalContextType, final String generalContextKey, final String generalContextValue) {
- this.generalContextType = generalContextType;
- this.generalContextKey = generalContextKey;
- this.generalContextValue = generalContextValue;
- }
-
- /**
- * get generalContextType.
- *
- * @return generalContextType
- */
- public String getGeneralContextType() {
- return generalContextType;
- }
-
- /**
- * set generalContextType.
- *
- * @param generalContextType generalContextType
- */
- public void setGeneralContextType(final String generalContextType) {
- this.generalContextType = generalContextType;
- }
-
- /**
- * get generalContextKey.
- *
- * @return generalContextKey
- */
- public String getGeneralContextKey() {
- return generalContextKey;
- }
-
- /**
- * set generalContextKey.
- *
- * @param generalContextKey generalContextKey
- */
- public void setGeneralContextKey(final String generalContextKey) {
- this.generalContextKey = generalContextKey;
- }
-
- /**
- * get generalContextValue.
- *
- * @return generalContextValue
- */
- public String getGeneralContextValue() {
- return generalContextValue;
- }
-
- /**
- * set generalContextValue.
- *
- * @param generalContextValue generalContextValue
- */
- public void setGeneralContextValue(final String generalContextValue) {
- this.generalContextValue = generalContextValue;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- GeneralContextHandle that = (GeneralContextHandle) o;
- return Objects.equals(generalContextType, that.generalContextType)
- && Objects.equals(generalContextKey, that.generalContextKey)
- && Objects.equals(generalContextValue, that.generalContextValue);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(generalContextType, generalContextKey, generalContextValue);
- }
-
- @Override
- public String toString() {
- return "GeneralContextHandleContent{"
- + "generalContextType='" + generalContextType + '\''
- + ", generalContextKey='" + generalContextKey + '\''
- + ", generalContextValue='" + generalContextValue + '\''
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/HystrixHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/HystrixHandle.java
deleted file mode 100644
index 30cd4dd..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/HystrixHandle.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule;
-
-import org.apache.shenyu.common.constant.Constants;
-import org.apache.shenyu.common.enums.HystrixIsolationModeEnum;
-
-import java.util.Objects;
-
-/**
- * this is hystrix handle.
- */
-public class HystrixHandle {
-
- /**
- * hystrix group key is required.
- */
- private String groupKey;
-
- /**
- * hystrix command key is required.
- */
- private String commandKey;
-
- /**
- * hystrix withExecutionIsolationSemaphoreMaxConcurrentRequests.
- */
- private int maxConcurrentRequests = Constants.MAX_CONCURRENT_REQUESTS;
-
- /**
- * hystrix withCircuitBreakerErrorThresholdPercentage.
- */
- private int errorThresholdPercentage = Constants.ERROR_THRESHOLD_PERCENTAGE;
-
- /**
- * hystrix withCircuitBreakerRequestVolumeThreshold.
- */
- private int requestVolumeThreshold = Constants.REQUEST_VOLUME_THRESHOLD;
-
- /**
- * hystrix withCircuitBreakerSleepWindowInMilliseconds.
- */
- private int sleepWindowInMilliseconds = Constants.SLEEP_WINDOW_INMILLISECONDS;
-
- /**
- * timeout is required.
- */
- private long timeout = Constants.TIME_OUT;
-
- /**
- * call back uri.
- * when some error occurs in hystrix invoke it will forward to this
- */
- private String callBackUri = "/fallback/hystrix";
-
- /**
- * Isolation strategy to use when executing a hystrix command.
- */
- private int executionIsolationStrategy = HystrixIsolationModeEnum.SEMAPHORE.getCode();
-
- /**
- * hystrix thread pool config.
- */
- private HystrixThreadPoolConfig hystrixThreadPoolConfig;
-
- /**
- * New instance hystrix handle.
- *
- * @return the hystrix handle
- */
- public static HystrixHandle newDefaultInstance() {
- return new HystrixHandle();
- }
-
- /**
- * get groupKey.
- *
- * @return groupKey group key
- */
- public String getGroupKey() {
- return groupKey;
- }
-
- /**
- * set groupKey.
- *
- * @param groupKey groupKey
- */
- public void setGroupKey(final String groupKey) {
- this.groupKey = groupKey;
- }
-
- /**
- * get commandKey.
- *
- * @return commandKey command key
- */
- public String getCommandKey() {
- return commandKey;
- }
-
- /**
- * set commandKey.
- *
- * @param commandKey commandKey
- */
- public void setCommandKey(final String commandKey) {
- this.commandKey = commandKey;
- }
-
- /**
- * get maxConcurrentRequests.
- *
- * @return maxConcurrentRequests max concurrent requests
- */
- public int getMaxConcurrentRequests() {
- return maxConcurrentRequests;
- }
-
- /**
- * set maxConcurrentRequests.
- *
- * @param maxConcurrentRequests maxConcurrentRequests
- */
- public void setMaxConcurrentRequests(final int maxConcurrentRequests) {
- this.maxConcurrentRequests = maxConcurrentRequests;
- }
-
- /**
- * get errorThresholdPercentage.
- *
- * @return errorThresholdPercentage error threshold percentage
- */
- public int getErrorThresholdPercentage() {
- return errorThresholdPercentage;
- }
-
- /**
- * set errorThresholdPercentage.
- *
- * @param errorThresholdPercentage errorThresholdPercentage
- */
- public void setErrorThresholdPercentage(final int errorThresholdPercentage) {
- this.errorThresholdPercentage = errorThresholdPercentage;
- }
-
- /**
- * get requestVolumeThreshold.
- *
- * @return requestVolumeThreshold request volume threshold
- */
- public int getRequestVolumeThreshold() {
- return requestVolumeThreshold;
- }
-
- /**
- * set requestVolumeThreshold.
- *
- * @param requestVolumeThreshold requestVolumeThreshold
- */
- public void setRequestVolumeThreshold(final int requestVolumeThreshold) {
- this.requestVolumeThreshold = requestVolumeThreshold;
- }
-
- /**
- * get sleepWindowInMilliseconds.
- *
- * @return sleepWindowInMilliseconds sleep window in milliseconds
- */
- public int getSleepWindowInMilliseconds() {
- return sleepWindowInMilliseconds;
- }
-
- /**
- * set sleepWindowInMilliseconds.
- *
- * @param sleepWindowInMilliseconds sleepWindowInMilliseconds
- */
- public void setSleepWindowInMilliseconds(final int sleepWindowInMilliseconds) {
- this.sleepWindowInMilliseconds = sleepWindowInMilliseconds;
- }
-
- /**
- * get timeout.
- *
- * @return timeout timeout
- */
- public long getTimeout() {
- return timeout;
- }
-
- /**
- * set timeout.
- *
- * @param timeout timeout
- */
- public void setTimeout(final long timeout) {
- this.timeout = timeout;
- }
-
- /**
- * get callBackUri.
- *
- * @return callBackUri call back uri
- */
- public String getCallBackUri() {
- return callBackUri;
- }
-
- /**
- * set callBackUri.
- *
- * @param callBackUri callBackUri
- */
- public void setCallBackUri(final String callBackUri) {
- this.callBackUri = callBackUri;
- }
-
- /**
- * get executionIsolationStrategy.
- *
- * @return executionIsolationStrategy execution isolation strategy
- */
- public int getExecutionIsolationStrategy() {
- return executionIsolationStrategy;
- }
-
- /**
- * set executionIsolationStrategy.
- *
- * @param executionIsolationStrategy executionIsolationStrategy
- */
- public void setExecutionIsolationStrategy(final int executionIsolationStrategy) {
- this.executionIsolationStrategy = executionIsolationStrategy;
- }
-
- /**
- * get hystrixThreadPoolConfig.
- *
- * @return hystrixThreadPoolConfig hystrix thread pool config
- */
- public HystrixThreadPoolConfig getHystrixThreadPoolConfig() {
- return hystrixThreadPoolConfig;
- }
-
- /**
- * set hystrixThreadPoolConfig.
- *
- * @param hystrixThreadPoolConfig hystrixThreadPoolConfig
- */
- public void setHystrixThreadPoolConfig(final HystrixThreadPoolConfig hystrixThreadPoolConfig) {
- this.hystrixThreadPoolConfig = hystrixThreadPoolConfig;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- HystrixHandle that = (HystrixHandle) o;
- return maxConcurrentRequests == that.maxConcurrentRequests && errorThresholdPercentage == that.errorThresholdPercentage
- && requestVolumeThreshold == that.requestVolumeThreshold && sleepWindowInMilliseconds == that.sleepWindowInMilliseconds
- && timeout == that.timeout && executionIsolationStrategy == that.executionIsolationStrategy && Objects.equals(groupKey, that.groupKey)
- && Objects.equals(commandKey, that.commandKey) && Objects.equals(callBackUri, that.callBackUri)
- && Objects.equals(hystrixThreadPoolConfig, that.hystrixThreadPoolConfig);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(groupKey, commandKey, maxConcurrentRequests, errorThresholdPercentage, requestVolumeThreshold,
- sleepWindowInMilliseconds, timeout, callBackUri, executionIsolationStrategy, hystrixThreadPoolConfig);
- }
-
- @Override
- public String toString() {
- return "HystrixHandle{"
- + "groupKey='"
- + groupKey
- + '\''
- + ", commandKey='"
- + commandKey
- + '\''
- + ", maxConcurrentRequests="
- + maxConcurrentRequests
- + ", errorThresholdPercentage="
- + errorThresholdPercentage
- + ", requestVolumeThreshold="
- + requestVolumeThreshold
- + ", sleepWindowInMilliseconds="
- + sleepWindowInMilliseconds
- + ", timeout="
- + timeout
- + ", callBackUri='"
- + callBackUri
- + '\''
- + ", executionIsolationStrategy="
- + executionIsolationStrategy
- + ", hystrixThreadPoolConfig="
- + hystrixThreadPoolConfig
- + '}';
- }
-
- /**
- * hystrix thread pool config.
- */
- public static class HystrixThreadPoolConfig {
-
- private int coreSize = Constants.HYSTRIX_THREAD_POOL_CORE_SIZE;
-
- private int maximumSize = Constants.HYSTRIX_THREAD_POOL_MAX_SIZE;
-
- private int keepAliveTimeMinutes = Constants.HYSTRIX_THREAD_KEEP_ALIVE_TIME_MINUTE;
-
- private int maxQueueSize = Constants.HYSTRIX_THREAD_POOL_QUEUE_SIZE;
-
- /**
- * get coreSize.
- *
- * @return coreSize core size
- */
- public int getCoreSize() {
- return coreSize;
- }
-
- /**
- * set coreSize.
- *
- * @param coreSize coreSize
- */
- public void setCoreSize(final int coreSize) {
- this.coreSize = coreSize;
- }
-
- /**
- * get maximumSize.
- *
- * @return maximumSize maximum size
- */
- public int getMaximumSize() {
- return maximumSize;
- }
-
- /**
- * set maximumSize.
- *
- * @param maximumSize maximumSize
- */
- public void setMaximumSize(final int maximumSize) {
- this.maximumSize = maximumSize;
- }
-
- /**
- * get keepAliveTimeMinutes.
- *
- * @return keepAliveTimeMinutes keep alive time minutes
- */
- public int getKeepAliveTimeMinutes() {
- return keepAliveTimeMinutes;
- }
-
- /**
- * set keepAliveTimeMinutes.
- *
- * @param keepAliveTimeMinutes keepAliveTimeMinutes
- */
- public void setKeepAliveTimeMinutes(final int keepAliveTimeMinutes) {
- this.keepAliveTimeMinutes = keepAliveTimeMinutes;
- }
-
- /**
- * get maxQueueSize.
- *
- * @return maxQueueSize max queue size
- */
- public int getMaxQueueSize() {
- return maxQueueSize;
- }
-
- /**
- * set maxQueueSize.
- *
- * @param maxQueueSize maxQueueSize
- */
- public void setMaxQueueSize(final int maxQueueSize) {
- this.maxQueueSize = maxQueueSize;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- HystrixThreadPoolConfig that = (HystrixThreadPoolConfig) o;
- return coreSize == that.coreSize && maximumSize == that.maximumSize && keepAliveTimeMinutes == that.keepAliveTimeMinutes && maxQueueSize == that.maxQueueSize;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(coreSize, maximumSize, keepAliveTimeMinutes, maxQueueSize);
- }
-
- @Override
- public String toString() {
- return "HystrixThreadPoolConfig{" + "coreSize=" + coreSize + ", maximumSize=" + maximumSize + ", keepAliveTimeMinutes=" + keepAliveTimeMinutes + ", maxQueueSize=" + maxQueueSize + '}';
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/MockHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/MockHandle.java
deleted file mode 100644
index 0391eb7..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/MockHandle.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule;
-
-import java.util.Objects;
-
-/**
- * this is RequestHandle plugin handle.
- */
-public class MockHandle {
-
- private Integer httpStatusCode;
-
- private String responseContent;
-
- /**
- * get http status code.
- * @return http status code.
- */
- public Integer getHttpStatusCode() {
- return httpStatusCode;
- }
-
- /**
- * set http status code.
- *
- * @param httpStatusCode http status code.
- */
- public void setHttpStatusCode(final Integer httpStatusCode) {
- this.httpStatusCode = httpStatusCode;
- }
-
- /**
- * get response content.
- *
- * @return content.
- */
- public String getResponseContent() {
- return responseContent;
- }
-
- /**
- * set response content.
- *
- * @param responseContent content.
- */
- public void setResponseContent(final String responseContent) {
- this.responseContent = responseContent;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- MockHandle that = (MockHandle) o;
- return Objects.equals(httpStatusCode, that.httpStatusCode) && Objects.equals(responseContent, that.responseContent);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(httpStatusCode, responseContent);
- }
-
- @Override
- public String toString() {
- return "MockHandle{"
- + "httpStatusCode="
- + httpStatusCode
- + ", responseContent='"
- + responseContent
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RateLimiterHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RateLimiterHandle.java
deleted file mode 100644
index 1a40c11..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RateLimiterHandle.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule;
-
-import java.util.Objects;
-
-/**
- * this is rateLimiter plugin handle.
- */
-public class RateLimiterHandle {
-
- /**
- * algorithm name.
- */
- private String algorithmName;
-
- /**
- * replenish rate.
- */
- private double replenishRate;
-
- /**
- * burst capacity.
- */
- private double burstCapacity;
-
- /**
- * request count.
- */
- private double requestCount = 1.0;
-
- /**
- * loged.
- */
- private boolean loged;
-
- /**
- * key resolver name.
- */
- private String keyResolverName;
-
- /**
- * New default instance rate limiter handle.
- *
- * @return the rate limiter handle
- */
- public static RateLimiterHandle newDefaultInstance() {
- RateLimiterHandle rateLimiterHandle = new RateLimiterHandle();
- rateLimiterHandle.setAlgorithmName("tokenBucket");
- rateLimiterHandle.setReplenishRate(1.0);
- rateLimiterHandle.setBurstCapacity(100.0);
- rateLimiterHandle.setRequestCount(1.0);
- rateLimiterHandle.setLoged(false);
- return rateLimiterHandle;
- }
-
- /**
- * get algorithmName.
- *
- * @return algorithmName algorithm name
- */
- public String getAlgorithmName() {
- return algorithmName;
- }
-
- /**
- * set algorithmName.
- *
- * @param algorithmName algorithmName
- */
- public void setAlgorithmName(final String algorithmName) {
- this.algorithmName = algorithmName;
- }
-
- /**
- * get replenishRate.
- *
- * @return replenishRate replenish rate
- */
- public double getReplenishRate() {
- return replenishRate;
- }
-
- /**
- * set replenishRate.
- *
- * @param replenishRate replenishRate
- */
- public void setReplenishRate(final double replenishRate) {
- this.replenishRate = replenishRate;
- }
-
- /**
- * get burstCapacity.
- *
- * @return burstCapacity burst capacity
- */
- public double getBurstCapacity() {
- return burstCapacity;
- }
-
- /**
- * set burstCapacity.
- *
- * @param burstCapacity burstCapacity
- */
- public void setBurstCapacity(final double burstCapacity) {
- this.burstCapacity = burstCapacity;
- }
-
- /**
- * get requestCount.
- *
- * @return requestCount request count
- */
- public double getRequestCount() {
- return requestCount;
- }
-
- /**
- * set requestCount.
- *
- * @param requestCount requestCount
- */
- public void setRequestCount(final double requestCount) {
- this.requestCount = requestCount;
- }
-
- /**
- * get loged.
- *
- * @return loged boolean
- */
- public boolean isLoged() {
- return loged;
- }
-
- /**
- * set loged.
- *
- * @param loged loged
- */
- public void setLoged(final boolean loged) {
- this.loged = loged;
- }
-
- /**
- * get keyResolverName.
- *
- * @return keyResolverName key resolver name
- */
- public String getKeyResolverName() {
- return keyResolverName;
- }
-
- /**
- * set keyResolverName.
- *
- * @param keyResolverName keyResolverName
- */
- public void setKeyResolverName(final String keyResolverName) {
- this.keyResolverName = keyResolverName;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- RateLimiterHandle that = (RateLimiterHandle) o;
- return Double.compare(that.replenishRate, replenishRate) == 0 && Double.compare(that.burstCapacity, burstCapacity) == 0
- && Double.compare(that.requestCount, requestCount) == 0 && loged == that.loged
- && Objects.equals(algorithmName, that.algorithmName) && Objects.equals(keyResolverName, that.keyResolverName);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(algorithmName, replenishRate, burstCapacity, requestCount, loged, keyResolverName);
- }
-
- @Override
- public String toString() {
- return "RateLimiterHandle{"
- + "algorithmName='"
- + algorithmName
- + '\''
- + ", replenishRate="
- + replenishRate
- + ", burstCapacity="
- + burstCapacity
- + ", requestCount="
- + requestCount
- + ", loged="
- + loged
- + ", keyResolverName='"
- + keyResolverName
- + '\''
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RedirectHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RedirectHandle.java
deleted file mode 100644
index 19f8bde..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RedirectHandle.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule;
-
-import java.util.Objects;
-
-/**
- * This is redirect plugin handle.
- */
-public class RedirectHandle {
-
- /**
- * http status code.
- */
- private Integer httpStatusCode = 302;
-
- /**
- * redirect url.
- */
- private String redirectURI;
-
- /**
- * Gets http status code.
- *
- * @return the http status code
- */
- public Integer getHttpStatusCode() {
- return httpStatusCode;
- }
-
- /**
- * Sets http status code.
- *
- * @param httpStatusCode the http status code
- */
- public void setHttpStatusCode(final Integer httpStatusCode) {
- this.httpStatusCode = httpStatusCode;
- }
-
- /**
- * get redirectURI.
- *
- * @return redirectURI redirect uri
- */
- public String getRedirectURI() {
- return redirectURI;
- }
-
- /**
- * set redirectURI.
- *
- * @param redirectURI redirectURI
- */
- public void setRedirectURI(final String redirectURI) {
- this.redirectURI = redirectURI;
- }
-
- @Override
- public String toString() {
- return "RedirectHandle{" + "httpStatusCode=" + httpStatusCode + ", redirectURI='" + redirectURI + '\'' + '}';
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- final RedirectHandle that = (RedirectHandle) o;
- return Objects.equals(httpStatusCode, that.httpStatusCode) && Objects.equals(redirectURI, that.redirectURI);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(httpStatusCode, redirectURI);
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RequestHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RequestHandle.java
deleted file mode 100644
index 7a68424..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RequestHandle.java
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule;
-
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.MapUtils;
-
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-
-/**
- * this is RequestHandle plugin handle.
- */
-public class RequestHandle {
-
- private ShenyuRequestHeader header;
-
- private ShenyuRequestParameter parameter;
-
- private ShenyuCookie cookie;
-
- /**
- * get header.
- *
- * @return header
- */
- public ShenyuRequestHeader getHeader() {
- return header;
- }
-
- /**
- * set header.
- *
- * @param header header
- */
- public void setHeader(final ShenyuRequestHeader header) {
- this.header = header;
- }
-
- /**
- * get parameter.
- *
- * @return parameter
- */
- public ShenyuRequestParameter getParameter() {
- return parameter;
- }
-
- /**
- * set parameter.
- *
- * @param parameter parameter
- */
- public void setParameter(final ShenyuRequestParameter parameter) {
- this.parameter = parameter;
- }
-
- /**
- * get cookie.
- *
- * @return cookie
- */
- public ShenyuCookie getCookie() {
- return cookie;
- }
-
- /**
- * set cookie.
- *
- * @param cookie cookie
- */
- public void setCookie(final ShenyuCookie cookie) {
- this.cookie = cookie;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- RequestHandle that = (RequestHandle) o;
- return Objects.equals(header, that.header) && Objects.equals(parameter, that.parameter) && Objects.equals(cookie, that.cookie);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(header, parameter, cookie);
- }
-
- @Override
- public String toString() {
- return "RequestHandle{"
- + "header="
- + header
- + ", parameter="
- + parameter
- + ", cookie="
- + cookie
- + '}';
- }
-
- /**
- * is empty config.
- *
- * @return empty is true
- */
- public boolean isEmptyConfig() {
- return !isNotEmptyConfig();
- }
-
- /**
- * is not empty config.
- *
- * @return not empty is true
- */
- private boolean isNotEmptyConfig() {
- return header.isNotEmptyConfig() || parameter.isNotEmptyConfig() || cookie.isNotEmptyConfig();
- }
-
- public class ShenyuRequestHeader {
- /**
- * need to be appended new header value.
- */
- private Map addHeaders;
-
- /**
- * new headerKey replaces old headerKey.
- * key: oldHeaderKey, value: newHeaderKey.
- */
- private Map replaceHeaderKeys;
-
- /**
- * need to be covered header value.
- * key: oldHeaderKey, value: newHeaderValue.
- */
- private Map setHeaders;
-
- /**
- * need to be removed headerKey.
- */
- private Set removeHeaderKeys;
-
- /**
- * no args constructor.
- */
- public ShenyuRequestHeader() {
- }
-
- /**
- * all args constructor.
- *
- * @param addHeaders addHeaders
- * @param replaceHeaderKeys replaceHeaderKeys
- * @param setHeaders setHeaders
- * @param removeHeaderKeys removeHeaderKeys
- */
- public ShenyuRequestHeader(final Map addHeaders, final Map replaceHeaderKeys,
- final Map setHeaders, final Set removeHeaderKeys) {
- this.addHeaders = addHeaders;
- this.replaceHeaderKeys = replaceHeaderKeys;
- this.setHeaders = setHeaders;
- this.removeHeaderKeys = removeHeaderKeys;
- }
-
- /**
- * get addHeaders.
- *
- * @return addHeaders
- */
- public Map getAddHeaders() {
- return addHeaders;
- }
-
- /**
- * set addHeaders.
- *
- * @param addHeaders addHeaders
- */
- public void setAddHeaders(final Map addHeaders) {
- this.addHeaders = addHeaders;
- }
-
- /**
- * get replaceHeaderKeys.
- *
- * @return replaceHeaderKeys
- */
- public Map getReplaceHeaderKeys() {
- return replaceHeaderKeys;
- }
-
- /**
- * set replaceHeaderKeys.
- *
- * @param replaceHeaderKeys replaceHeaderKeys
- */
- public void setReplaceHeaderKeys(final Map replaceHeaderKeys) {
- this.replaceHeaderKeys = replaceHeaderKeys;
- }
-
- /**
- * get setHeaders.
- *
- * @return setHeaders
- */
- public Map getSetHeaders() {
- return setHeaders;
- }
-
- /**
- * set setHeaders.
- *
- * @param setHeaders setHeaders
- */
- public void setSetHeaders(final Map setHeaders) {
- this.setHeaders = setHeaders;
- }
-
- /**
- * get removeHeaderKeys.
- *
- * @return removeHeaderKeys
- */
- public Set getRemoveHeaderKeys() {
- return removeHeaderKeys;
- }
-
- /**
- * set removeHeaderKeys.
- *
- * @param removeHeaderKeys removeHeaderKeys
- */
- public void setRemoveHeaderKeys(final Set removeHeaderKeys) {
- this.removeHeaderKeys = removeHeaderKeys;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- ShenyuRequestHeader that = (ShenyuRequestHeader) o;
- return Objects.equals(addHeaders, that.addHeaders) && Objects.equals(replaceHeaderKeys, that.replaceHeaderKeys)
- && Objects.equals(setHeaders, that.setHeaders) && Objects.equals(removeHeaderKeys, that.removeHeaderKeys);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(addHeaders, replaceHeaderKeys, setHeaders, removeHeaderKeys);
- }
-
- @Override
- public String toString() {
- return "ShenyuRequestHeader{"
- + "addHeaders="
- + addHeaders
- + ", replaceHeaderKeys="
- + replaceHeaderKeys
- + ", setHeaders="
- + setHeaders
- + ", removeHeaderKeys="
- + removeHeaderKeys
- + '}';
- }
-
- /**
- * is not empty config.
- *
- * @return not empty is true
- */
- public boolean isNotEmptyConfig() {
- return MapUtils.isNotEmpty(addHeaders) || MapUtils.isNotEmpty(replaceHeaderKeys)
- || MapUtils.isNotEmpty(setHeaders) || CollectionUtils.isNotEmpty(removeHeaderKeys);
- }
- }
-
- public class ShenyuRequestParameter {
-
- private Map addParameters;
-
- private Map replaceParameterKeys;
-
- private Map setParameters;
-
- private Set removeParameterKeys;
-
- /**
- * no args constructor.
- */
- public ShenyuRequestParameter() {
- }
-
- /**
- * all args constructor.
- *
- * @param addParameters addParameters
- * @param replaceParameterKeys replaceParameterKeys
- * @param setParameters setParameters
- * @param removeParameterKeys removeParameterKeys
- */
- public ShenyuRequestParameter(final Map addParameters, final Map replaceParameterKeys,
- final Map setParameters, final Set removeParameterKeys) {
- this.addParameters = addParameters;
- this.replaceParameterKeys = replaceParameterKeys;
- this.setParameters = setParameters;
- this.removeParameterKeys = removeParameterKeys;
- }
-
- /**
- * get addParameters.
- *
- * @return addParameters
- */
- public Map getAddParameters() {
- return addParameters;
- }
-
- /**
- * set addParameters.
- *
- * @param addParameters addParameters
- */
- public void setAddParameters(final Map addParameters) {
- this.addParameters = addParameters;
- }
-
- /**
- * get replaceParameterKeys.
- *
- * @return replaceParameterKeys
- */
- public Map getReplaceParameterKeys() {
- return replaceParameterKeys;
- }
-
- /**
- * set replaceParameterKeys.
- *
- * @param replaceParameterKeys replaceParameterKeys
- */
- public void setReplaceParameterKeys(final Map replaceParameterKeys) {
- this.replaceParameterKeys = replaceParameterKeys;
- }
-
- /**
- * get setParameters.
- *
- * @return setParameters
- */
- public Map getSetParameters() {
- return setParameters;
- }
-
- /**
- * set setParameters.
- *
- * @param setParameters setParameters
- */
- public void setSetParameters(final Map setParameters) {
- this.setParameters = setParameters;
- }
-
- /**
- * get removeParameterKeys.
- *
- * @return removeParameterKeys
- */
- public Set getRemoveParameterKeys() {
- return removeParameterKeys;
- }
-
- /**
- * set removeParameterKeys.
- *
- * @param removeParameterKeys removeParameterKeys
- */
- public void setRemoveParameterKeys(final Set removeParameterKeys) {
- this.removeParameterKeys = removeParameterKeys;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- ShenyuRequestParameter that = (ShenyuRequestParameter) o;
- return Objects.equals(addParameters, that.addParameters) && Objects.equals(replaceParameterKeys, that.replaceParameterKeys)
- && Objects.equals(setParameters, that.setParameters) && Objects.equals(removeParameterKeys, that.removeParameterKeys);
- }
-
- @Override
- public String toString() {
- return "ShenyuRequestParameter{"
- + "addParameters="
- + addParameters
- + ", replaceParameterKeys="
- + replaceParameterKeys
- + ", setParameters="
- + setParameters
- + ", removeParameterKeys="
- + removeParameterKeys
- + '}';
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(addParameters, replaceParameterKeys, setParameters, removeParameterKeys);
- }
-
- /**
- * is not empty config.
- *
- * @return not empty is true
- */
- public boolean isNotEmptyConfig() {
- return MapUtils.isNotEmpty(addParameters) || MapUtils.isNotEmpty(replaceParameterKeys)
- || MapUtils.isNotEmpty(setParameters) || CollectionUtils.isNotEmpty(removeParameterKeys);
- }
- }
-
- public class ShenyuCookie {
- private Map addCookies;
-
- private Map replaceCookieKeys;
-
- private Map setCookies;
-
- private Set removeCookieKeys;
-
- /**
- * no args constructor.
- */
- public ShenyuCookie() {
- }
-
- /**
- * all args constructor.
- *
- * @param addCookies addCookies
- * @param replaceCookieKeys replaceCookieKeys
- * @param setCookies setCookies
- * @param removeCookieKeys removeCookieKeys
- */
- public ShenyuCookie(final Map addCookies, final Map replaceCookieKeys,
- final Map setCookies, final Set removeCookieKeys) {
- this.addCookies = addCookies;
- this.replaceCookieKeys = replaceCookieKeys;
- this.setCookies = setCookies;
- this.removeCookieKeys = removeCookieKeys;
- }
-
- /**
- * get addCookies.
- *
- * @return addCookies
- */
- public Map getAddCookies() {
- return addCookies;
- }
-
- /**
- * set addCookies.
- *
- * @param addCookies addCookies
- */
- public void setAddCookies(final Map addCookies) {
- this.addCookies = addCookies;
- }
-
- /**
- * get replaceCookieKeys.
- *
- * @return replaceCookieKeys
- */
- public Map getReplaceCookieKeys() {
- return replaceCookieKeys;
- }
-
- /**
- * set replaceCookieKeys.
- *
- * @param replaceCookieKeys replaceCookieKeys
- */
- public void setReplaceCookieKeys(final Map replaceCookieKeys) {
- this.replaceCookieKeys = replaceCookieKeys;
- }
-
- /**
- * get setCookies.
- *
- * @return setCookies
- */
- public Map getSetCookies() {
- return setCookies;
- }
-
- /**
- * set setCookies.
- *
- * @param setCookies setCookies
- */
- public void setSetCookies(final Map setCookies) {
- this.setCookies = setCookies;
- }
-
- /**
- * get removeCookieKeys.
- *
- * @return removeCookieKeys
- */
- public Set getRemoveCookieKeys() {
- return removeCookieKeys;
- }
-
- /**
- * set removeCookieKeys.
- *
- * @param removeCookieKeys removeCookieKeys
- */
- public void setRemoveCookieKeys(final Set removeCookieKeys) {
- this.removeCookieKeys = removeCookieKeys;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- ShenyuCookie that = (ShenyuCookie) o;
- return Objects.equals(addCookies, that.addCookies) && Objects.equals(replaceCookieKeys, that.replaceCookieKeys)
- && Objects.equals(setCookies, that.setCookies) && Objects.equals(removeCookieKeys, that.removeCookieKeys);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(addCookies, replaceCookieKeys, setCookies, removeCookieKeys);
- }
-
- @Override
- public String toString() {
- return "ShenyuCookie{"
- + "addCookies="
- + addCookies
- + ", replaceCookieKeys="
- + replaceCookieKeys
- + ", setCookies="
- + setCookies
- + ", removeCookieKeys="
- + removeCookieKeys
- + '}';
- }
-
- /**
- * is not empty config.
- *
- * @return not empty is true
- */
- public boolean isNotEmptyConfig() {
- return MapUtils.isNotEmpty(addCookies) || MapUtils.isNotEmpty(replaceCookieKeys)
- || MapUtils.isNotEmpty(setCookies) || CollectionUtils.isNotEmpty(removeCookieKeys);
- }
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/Resilience4JHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/Resilience4JHandle.java
deleted file mode 100644
index 7486966..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/Resilience4JHandle.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule;
-
-import org.apache.shenyu.common.constant.Constants;
-
-import java.util.Objects;
-
-/**
- * this is Resilience4J plugin handle.
- */
-public class Resilience4JHandle {
-
- /**
- * ratelimiter timeoutDurationRate.
- */
- private int timeoutDurationRate = Constants.TIMEOUT_DURATION_RATE;
-
- /**
- * ratelimiter limitRefreshPeriod.
- */
- private int limitRefreshPeriod = Constants.LIMIT_REFRESH_PERIOD;
-
- /**
- * ratelimiter limitForPeriod.
- */
- private int limitForPeriod = Constants.LIMIT_FOR_PERIOD;
-
- /**
- * circuitBreaker circuitEnable.
- */
- private int circuitEnable = Constants.CIRCUIT_DISABLE;
-
- /**
- * circuitBreaker timeoutDuration.
- */
- private long timeoutDuration = Constants.TIMEOUT_DURATION;
-
- /**
- * circuitBreaker fallbackUri.
- */
- private String fallbackUri = "/fallback/resilience4j";
-
- /**
- * circuitBreaker slidingWindowSize.
- */
- private int slidingWindowSize = Constants.SLIDING_WINDOW_SIZE;
-
- /**
- * circuitBreaker slidingWindowType.
- */
- private int slidingWindowType = Constants.SLIDING_WINDOW_TYPE;
-
- /**
- * circuitBreaker minimumNumberOfCalls.
- */
- private int minimumNumberOfCalls = Constants.MINIMUM_NUMBER_OF_CALLS;
-
- /**
- * circuitBreaker waitIntervalFunctionInOpenState.
- */
- private int waitIntervalFunctionInOpenState = Constants.WAIT_INTERVAL_FUNCTION_IN_OPEN_STATE;
-
- /**
- * circuitBreaker permittedNumberOfCallsInHalfOpenState.
- */
- private int permittedNumberOfCallsInHalfOpenState = Constants.PERMITTED_NUMBER_OF_CALLS_IN_HALF_OPEN_STATE;
-
- /**
- * circuitBreaker failureRateThreshold.
- */
- private float failureRateThreshold = Constants.FAILURE_RATE_THRESHOLD;
-
- /**
- * circuitBreaker automaticTransitionFromOpenToHalfOpenEnabled.
- */
- private Boolean automaticTransitionFromOpenToHalfOpenEnabled = Constants.AUTOMATIC_TRANSITION_FROM_OPEN_TO_HALF_OPEN_ENABLED;
-
- /**
- * New default instance resilience 4 j handle.
- *
- * @return the resilience 4 j handle
- */
- public static Resilience4JHandle newDefaultInstance() {
- return new Resilience4JHandle();
- }
-
- /**
- * get timeoutDurationRate.
- *
- * @return timeoutDurationRate timeout duration rate
- */
- public int getTimeoutDurationRate() {
- return timeoutDurationRate;
- }
-
- /**
- * set timeoutDurationRate.
- *
- * @param timeoutDurationRate timeoutDurationRate
- */
- public void setTimeoutDurationRate(final int timeoutDurationRate) {
- this.timeoutDurationRate = timeoutDurationRate;
- }
-
- /**
- * get limitRefreshPeriod.
- *
- * @return limitRefreshPeriod limit refresh period
- */
- public int getLimitRefreshPeriod() {
- return limitRefreshPeriod;
- }
-
- /**
- * set limitRefreshPeriod.
- *
- * @param limitRefreshPeriod limitRefreshPeriod
- */
- public void setLimitRefreshPeriod(final int limitRefreshPeriod) {
- this.limitRefreshPeriod = limitRefreshPeriod;
- }
-
- /**
- * get limitForPeriod.
- *
- * @return limitForPeriod limit for period
- */
- public int getLimitForPeriod() {
- return limitForPeriod;
- }
-
- /**
- * set limitForPeriod.
- *
- * @param limitForPeriod limitForPeriod
- */
- public void setLimitForPeriod(final int limitForPeriod) {
- this.limitForPeriod = limitForPeriod;
- }
-
- /**
- * get circuitEnable.
- *
- * @return circuitEnable circuit enable
- */
- public int getCircuitEnable() {
- return circuitEnable;
- }
-
- /**
- * set circuitEnable.
- *
- * @param circuitEnable circuitEnable
- */
- public void setCircuitEnable(final int circuitEnable) {
- this.circuitEnable = circuitEnable;
- }
-
- /**
- * get timeoutDuration.
- *
- * @return timeoutDuration timeout duration
- */
- public long getTimeoutDuration() {
- return timeoutDuration;
- }
-
- /**
- * set timeoutDuration.
- *
- * @param timeoutDuration timeoutDuration
- */
- public void setTimeoutDuration(final long timeoutDuration) {
- this.timeoutDuration = timeoutDuration;
- }
-
- /**
- * get fallbackUri.
- *
- * @return fallbackUri fallback uri
- */
- public String getFallbackUri() {
- return fallbackUri;
- }
-
- /**
- * set fallbackUri.
- *
- * @param fallbackUri fallbackUri
- */
- public void setFallbackUri(final String fallbackUri) {
- this.fallbackUri = fallbackUri;
- }
-
- /**
- * get slidingWindowSize.
- *
- * @return slidingWindowSize sliding window size
- */
- public int getSlidingWindowSize() {
- return slidingWindowSize;
- }
-
- /**
- * set slidingWindowSize.
- *
- * @param slidingWindowSize slidingWindowSize
- */
- public void setSlidingWindowSize(final int slidingWindowSize) {
- this.slidingWindowSize = slidingWindowSize;
- }
-
- /**
- * get slidingWindowType.
- *
- * @return slidingWindowType sliding window type
- */
- public int getSlidingWindowType() {
- return slidingWindowType;
- }
-
- /**
- * set slidingWindowType.
- *
- * @param slidingWindowType slidingWindowType
- */
- public void setSlidingWindowType(final int slidingWindowType) {
- this.slidingWindowType = slidingWindowType;
- }
-
- /**
- * get minimumNumberOfCalls.
- *
- * @return minimumNumberOfCalls minimum number of calls
- */
- public int getMinimumNumberOfCalls() {
- return minimumNumberOfCalls;
- }
-
- /**
- * set minimumNumberOfCalls.
- *
- * @param minimumNumberOfCalls minimumNumberOfCalls
- */
- public void setMinimumNumberOfCalls(final int minimumNumberOfCalls) {
- this.minimumNumberOfCalls = minimumNumberOfCalls;
- }
-
- /**
- * get waitIntervalFunctionInOpenState.
- *
- * @return waitIntervalFunctionInOpenState wait interval function in open state
- */
- public int getWaitIntervalFunctionInOpenState() {
- return waitIntervalFunctionInOpenState;
- }
-
- /**
- * set waitIntervalFunctionInOpenState.
- *
- * @param waitIntervalFunctionInOpenState waitIntervalFunctionInOpenState
- */
- public void setWaitIntervalFunctionInOpenState(final int waitIntervalFunctionInOpenState) {
- this.waitIntervalFunctionInOpenState = waitIntervalFunctionInOpenState;
- }
-
- /**
- * get permittedNumberOfCallsInHalfOpenState.
- *
- * @return permittedNumberOfCallsInHalfOpenState permitted number of calls in half open state
- */
- public int getPermittedNumberOfCallsInHalfOpenState() {
- return permittedNumberOfCallsInHalfOpenState;
- }
-
- /**
- * set permittedNumberOfCallsInHalfOpenState.
- *
- * @param permittedNumberOfCallsInHalfOpenState permittedNumberOfCallsInHalfOpenState
- */
- public void setPermittedNumberOfCallsInHalfOpenState(final int permittedNumberOfCallsInHalfOpenState) {
- this.permittedNumberOfCallsInHalfOpenState = permittedNumberOfCallsInHalfOpenState;
- }
-
- /**
- * get failureRateThreshold.
- *
- * @return failureRateThreshold failure rate threshold
- */
- public float getFailureRateThreshold() {
- return failureRateThreshold;
- }
-
- /**
- * set failureRateThreshold.
- *
- * @param failureRateThreshold failureRateThreshold
- */
- public void setFailureRateThreshold(final float failureRateThreshold) {
- this.failureRateThreshold = failureRateThreshold;
- }
-
- /**
- * get automaticTransitionFromOpenToHalfOpenEnabled.
- *
- * @return automaticTransitionFromOpenToHalfOpenEnabled automatic transition from open to half open enabled
- */
- public Boolean getAutomaticTransitionFromOpenToHalfOpenEnabled() {
- return automaticTransitionFromOpenToHalfOpenEnabled;
- }
-
- /**
- * set automaticTransitionFromOpenToHalfOpenEnabled.
- *
- * @param automaticTransitionFromOpenToHalfOpenEnabled automaticTransitionFromOpenToHalfOpenEnabled
- */
- public void setAutomaticTransitionFromOpenToHalfOpenEnabled(final Boolean automaticTransitionFromOpenToHalfOpenEnabled) {
- this.automaticTransitionFromOpenToHalfOpenEnabled = automaticTransitionFromOpenToHalfOpenEnabled;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- Resilience4JHandle that = (Resilience4JHandle) o;
- return timeoutDurationRate == that.timeoutDurationRate && limitRefreshPeriod == that.limitRefreshPeriod && limitForPeriod == that.limitForPeriod
- && circuitEnable == that.circuitEnable && timeoutDuration == that.timeoutDuration && slidingWindowSize == that.slidingWindowSize
- && slidingWindowType == that.slidingWindowType && minimumNumberOfCalls == that.minimumNumberOfCalls
- && waitIntervalFunctionInOpenState == that.waitIntervalFunctionInOpenState && permittedNumberOfCallsInHalfOpenState == that.permittedNumberOfCallsInHalfOpenState
- && Float.compare(that.failureRateThreshold, failureRateThreshold) == 0 && Objects.equals(fallbackUri, that.fallbackUri)
- && Objects.equals(automaticTransitionFromOpenToHalfOpenEnabled, that.automaticTransitionFromOpenToHalfOpenEnabled);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(timeoutDurationRate, limitRefreshPeriod, limitForPeriod, circuitEnable, timeoutDuration, fallbackUri,
- slidingWindowSize, slidingWindowType, minimumNumberOfCalls, waitIntervalFunctionInOpenState,
- permittedNumberOfCallsInHalfOpenState, failureRateThreshold, automaticTransitionFromOpenToHalfOpenEnabled);
- }
-
- @Override
- public String toString() {
- return "Resilience4JHandle{"
- + "timeoutDurationRate="
- + timeoutDurationRate
- + ", limitRefreshPeriod="
- + limitRefreshPeriod
- + ", limitForPeriod="
- + limitForPeriod
- + ", circuitEnable="
- + circuitEnable
- + ", timeoutDuration="
- + timeoutDuration
- + ", fallbackUri='"
- + fallbackUri
- + '\''
- + ", slidingWindowSize="
- + slidingWindowSize
- + ", slidingWindowType="
- + slidingWindowType
- + ", minimumNumberOfCalls="
- + minimumNumberOfCalls
- + ", waitIntervalFunctionInOpenState="
- + waitIntervalFunctionInOpenState
- + ", permittedNumberOfCallsInHalfOpenState="
- + permittedNumberOfCallsInHalfOpenState
- + ", failureRateThreshold="
- + failureRateThreshold
- + ", automaticTransitionFromOpenToHalfOpenEnabled="
- + automaticTransitionFromOpenToHalfOpenEnabled
- + '}';
- }
-
- /**
- * check filed default value.
- *
- * @param resilience4JHandle {@linkplain Resilience4JHandle}
- */
- public void checkData(final Resilience4JHandle resilience4JHandle) {
- resilience4JHandle.setTimeoutDurationRate(resilience4JHandle.getTimeoutDurationRate() < 0 ? Constants.TIMEOUT_DURATION_RATE : resilience4JHandle.getTimeoutDurationRate());
- resilience4JHandle.setLimitRefreshPeriod(resilience4JHandle.getLimitRefreshPeriod() < 0 ? Constants.LIMIT_REFRESH_PERIOD : resilience4JHandle.getLimitRefreshPeriod());
- resilience4JHandle.setLimitForPeriod(resilience4JHandle.getLimitForPeriod() < 0 ? Constants.LIMIT_FOR_PERIOD : resilience4JHandle.getLimitForPeriod());
- resilience4JHandle.setCircuitEnable(resilience4JHandle.getCircuitEnable() != Constants.CIRCUIT_ENABLE ? Constants.CIRCUIT_DISABLE : Constants.CIRCUIT_ENABLE);
- resilience4JHandle.setTimeoutDuration(resilience4JHandle.getTimeoutDuration() < 0 ? Constants.TIMEOUT_DURATION : resilience4JHandle.getTimeoutDuration());
- resilience4JHandle.setFallbackUri(!"0".equals(resilience4JHandle.getFallbackUri()) ? resilience4JHandle.getFallbackUri() : "");
- resilience4JHandle.setSlidingWindowSize(resilience4JHandle.getSlidingWindowSize() < 0 ? Constants.SLIDING_WINDOW_SIZE : resilience4JHandle.getSlidingWindowSize());
- resilience4JHandle.setSlidingWindowType(resilience4JHandle.getSlidingWindowType() < 0 ? Constants.SLIDING_WINDOW_TYPE : resilience4JHandle.getSlidingWindowType());
- resilience4JHandle.setMinimumNumberOfCalls(resilience4JHandle.getMinimumNumberOfCalls() < 0 ? Constants.MINIMUM_NUMBER_OF_CALLS : resilience4JHandle.getMinimumNumberOfCalls());
- resilience4JHandle.setWaitIntervalFunctionInOpenState(resilience4JHandle.getWaitIntervalFunctionInOpenState() < 0
- ? Constants.WAIT_INTERVAL_FUNCTION_IN_OPEN_STATE : resilience4JHandle.getWaitIntervalFunctionInOpenState());
- resilience4JHandle.setPermittedNumberOfCallsInHalfOpenState(resilience4JHandle.getPermittedNumberOfCallsInHalfOpenState() < 0
- ? Constants.PERMITTED_NUMBER_OF_CALLS_IN_HALF_OPEN_STATE : resilience4JHandle.getPermittedNumberOfCallsInHalfOpenState());
- resilience4JHandle.setFailureRateThreshold(
- resilience4JHandle.getFailureRateThreshold() < 0 || resilience4JHandle.getFailureRateThreshold() > 100
- ? Constants.FAILURE_RATE_THRESHOLD : resilience4JHandle.getFailureRateThreshold());
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RewriteHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RewriteHandle.java
deleted file mode 100644
index c60b7f5..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RewriteHandle.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule;
-
-import java.util.Objects;
-
-/**
- * this is rewrite plugin handle.
- */
-public class RewriteHandle {
-
- /**
- * java regular expression.
- */
- private String regex;
-
- /**
- * replace string.
- */
- private String replace;
-
- /**
- * percentage of rewritten traffic.
- */
- private Integer percentage;
-
- /**
- * rewrite the original metadata.
- */
- private Boolean rewriteMetaData;
-
- /**
- * get regex.
- *
- * @return regex
- */
- public String getRegex() {
- return regex;
- }
-
- /**
- * set regex.
- *
- * @param regex regex
- */
- public void setRegex(final String regex) {
- this.regex = regex;
- }
-
- /**
- * get replace.
- *
- * @return replace
- */
- public String getReplace() {
- return replace;
- }
-
- /**
- * set replace.
- *
- * @param replace replace
- */
- public void setReplace(final String replace) {
- this.replace = replace;
- }
-
- /**
- * get percentage.
- *
- * @return percentage
- */
- public Integer getPercentage() {
- return percentage;
- }
-
- /**
- * set percentage.
- *
- * @param percentage percentage
- */
- public void setPercentage(final Integer percentage) {
- this.percentage = percentage;
- }
-
- /**
- * get rewrite meta data status.
- *
- * @return rewrite meta data status
- */
- public Boolean getRewriteMetaData() {
- return rewriteMetaData;
- }
-
- /**
- * set rewrite meta data.
- *
- * @param rewriteMetaData status
- */
- public void setRewriteMetaData(final Boolean rewriteMetaData) {
- this.rewriteMetaData = rewriteMetaData;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- RewriteHandle that = (RewriteHandle) o;
- return Objects.equals(regex, that.regex) && Objects.equals(replace, that.replace)
- && Objects.equals(rewriteMetaData, that.rewriteMetaData);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(regex, replace, rewriteMetaData);
- }
-
- @Override
- public String toString() {
- return "RewriteHandle{"
- + "regex='"
- + regex
- + '\''
- + ", replace='"
- + replace
- + '\''
- + ", percentage='"
- + percentage
- + '\''
- + ", rewriteMetaData='"
- + rewriteMetaData
- + '\''
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RuleHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RuleHandle.java
deleted file mode 100644
index 4d612be..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/RuleHandle.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule;
-
-import org.apache.shenyu.common.utils.GsonUtils;
-
-/**
- * The RuleHandle interface.
- */
-public interface RuleHandle {
-
- /**
- * Format this object to json string.
- * @return json string.
- */
- default String toJson() {
- return GsonUtils.getGson().toJson(this);
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/SentinelHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/SentinelHandle.java
deleted file mode 100644
index 2835605..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/SentinelHandle.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule;
-
-import org.apache.shenyu.common.constant.Constants;
-
-import java.util.Objects;
-
-/**
- * This is SentinelHandle.
- */
-public class SentinelHandle {
-
- /**
- * Flow rule enable.
- */
- private Integer flowRuleEnable = Constants.SENTINEL_ENABLE_FLOW_RULE;
-
- /**
- * Flow rule grade.
- */
- private Integer flowRuleGrade = Constants.SENTINEL_QPS_FLOW_GRADE;
-
- /**
- * Max queueing time in rate limiter behavior (ms).
- */
- private int flowRuleMaxQueueingTimeMs = 500;
-
-
- /**
- * The flow control warm-up time (s).
- */
- private int flowRuleWarmUpPeriodSec = 10;
-
- /**
- * Flow rule count.
- */
- private Integer flowRuleCount;
-
- /**
- * Flow rule control behavior.
- */
- private Integer flowRuleControlBehavior = Constants.SENTINEL_FLOW_REJECT;
-
- /**
- * Degrade rule control behavior.
- */
- private Integer degradeRuleEnable = Constants.SENTINEL_ENABLE_DEGRADE_RULE;
-
- /**
- * Degrade rule grade.
- */
- private Integer degradeRuleGrade = Constants.SENTINEL_RESPONSE_RULE_GRADE;
-
- /**
- * Degrade rule count.
- */
- private Double degradeRuleCount;
-
- /**
- * Degrade rule time window.
- */
- private Integer degradeRuleTimeWindow;
-
- /**
- * Degrade rule min request amount.
- */
- private Integer degradeRuleMinRequestAmount = Constants.SENTINEL_MIN_REQUEST_AMOUNT;
-
- /**
- * Degrade rule slow ratio threshold.
- */
- private Double degradeRuleSlowRatioThreshold = Constants.SENTINEL_SLOW_RATIO_THRESHOLD;
-
- /**
- * Degrade rule stat intervalMs.
- */
- private int degradeRuleStatIntervals = Constants.SENTINEL_STAT_INTERVALS;
-
- /**
- * Sentinel fallback uri.
- */
- private String fallbackUri = "/fallback/sentinel";
-
- /**
- * New default instance sentinel handle.
- *
- * @return the sentinel handle
- */
- public static SentinelHandle newDefaultInstance() {
- return new SentinelHandle();
- }
-
- /**
- * get flowRuleEnable.
- *
- * @return flowRuleEnable flow rule enable
- */
- public Integer getFlowRuleEnable() {
- return flowRuleEnable;
- }
-
- /**
- * set flowRuleEnable.
- *
- * @param flowRuleEnable flowRuleEnable
- */
- public void setFlowRuleEnable(final Integer flowRuleEnable) {
- this.flowRuleEnable = flowRuleEnable;
- }
-
- /**
- * get flowRuleGrade.
- *
- * @return flowRuleGrade flow rule grade
- */
- public Integer getFlowRuleGrade() {
- return flowRuleGrade;
- }
-
- /**
- * set flowRuleGrade.
- *
- * @param flowRuleGrade flowRuleGrade
- */
- public void setFlowRuleGrade(final Integer flowRuleGrade) {
- this.flowRuleGrade = flowRuleGrade;
- }
-
- /**
- * get flowRuleCount.
- *
- * @return flowRuleCount flow rule count
- */
- public Integer getFlowRuleCount() {
- return flowRuleCount;
- }
-
- /**
- * set flowRuleCount.
- *
- * @param flowRuleCount flowRuleCount
- */
- public void setFlowRuleCount(final Integer flowRuleCount) {
- this.flowRuleCount = flowRuleCount;
- }
-
- /**
- * get flowRuleControlBehavior.
- *
- * @return flowRuleControlBehavior flow rule control behavior
- */
- public Integer getFlowRuleControlBehavior() {
- return flowRuleControlBehavior;
- }
-
- /**
- * set flowRuleControlBehavior.
- *
- * @param flowRuleControlBehavior flowRuleControlBehavior
- */
- public void setFlowRuleControlBehavior(final Integer flowRuleControlBehavior) {
- this.flowRuleControlBehavior = flowRuleControlBehavior;
- }
-
- /**
- * get degradeRuleEnable.
- *
- * @return degradeRuleEnable degrade rule enable
- */
- public Integer getDegradeRuleEnable() {
- return degradeRuleEnable;
- }
-
- /**
- * set degradeRuleEnable.
- *
- * @param degradeRuleEnable degradeRuleEnable
- */
- public void setDegradeRuleEnable(final Integer degradeRuleEnable) {
- this.degradeRuleEnable = degradeRuleEnable;
- }
-
- /**
- * get degradeRuleGrade.
- *
- * @return degradeRuleGrade degrade rule grade
- */
- public Integer getDegradeRuleGrade() {
- return degradeRuleGrade;
- }
-
- /**
- * set degradeRuleGrade.
- *
- * @param degradeRuleGrade degradeRuleGrade
- */
- public void setDegradeRuleGrade(final Integer degradeRuleGrade) {
- this.degradeRuleGrade = degradeRuleGrade;
- }
-
- /**
- * get degradeRuleCount.
- *
- * @return degradeRuleCount degrade rule count
- */
- public Double getDegradeRuleCount() {
- return degradeRuleCount;
- }
-
- /**
- * set degradeRuleCount.
- *
- * @param degradeRuleCount degradeRuleCount
- */
- public void setDegradeRuleCount(final Double degradeRuleCount) {
- this.degradeRuleCount = degradeRuleCount;
- }
-
- /**
- * get degradeRuleTimeWindow.
- *
- * @return degradeRuleTimeWindow degrade rule time window
- */
- public Integer getDegradeRuleTimeWindow() {
- return degradeRuleTimeWindow;
- }
-
- /**
- * set degradeRuleTimeWindow.
- *
- * @param degradeRuleTimeWindow degradeRuleTimeWindow
- */
- public void setDegradeRuleTimeWindow(final Integer degradeRuleTimeWindow) {
- this.degradeRuleTimeWindow = degradeRuleTimeWindow;
- }
-
- /**
- * get degradeRuleMinRequestAmount.
- *
- * @return degradeRuleMinRequestAmount degrade rule min request amount
- */
- public Integer getDegradeRuleMinRequestAmount() {
- return degradeRuleMinRequestAmount;
- }
-
- /**
- * set degradeRuleMinRequestAmount.
- *
- * @param degradeRuleMinRequestAmount degradeRuleMinRequestAmount
- */
- public void setDegradeRuleMinRequestAmount(final Integer degradeRuleMinRequestAmount) {
- this.degradeRuleMinRequestAmount = degradeRuleMinRequestAmount;
- }
-
- /**
- * get degradeRuleSlowRatioThreshold.
- *
- * @return degradeRuleSlowRatioThreshold degrade rule slow ratio threshold
- */
- public Double getDegradeRuleSlowRatioThreshold() {
- return degradeRuleSlowRatioThreshold;
- }
-
- /**
- * set degradeRuleSlowRatioThreshold.
- *
- * @param degradeRuleSlowRatioThreshold degradeRuleSlowRatioThreshold
- */
- public void setDegradeRuleSlowRatioThreshold(final Double degradeRuleSlowRatioThreshold) {
- this.degradeRuleSlowRatioThreshold = degradeRuleSlowRatioThreshold;
- }
-
- /**
- * get degradeRuleStatIntervals.
- *
- * @return degradeRuleStatIntervals degrade rule stat intervals
- */
- public int getDegradeRuleStatIntervals() {
- return degradeRuleStatIntervals;
- }
-
- /**
- * set degradeRuleStatIntervals.
- *
- * @param degradeRuleStatIntervals degradeRuleStatIntervals
- */
- public void setDegradeRuleStatIntervals(final int degradeRuleStatIntervals) {
- this.degradeRuleStatIntervals = degradeRuleStatIntervals;
- }
-
- /**
- * get fallbackUri.
- *
- * @return fallbackUri fallback uri
- */
- public String getFallbackUri() {
- return fallbackUri;
- }
-
- /**
- * set fallbackUri.
- *
- * @param fallbackUri fallbackUri
- */
- public void setFallbackUri(final String fallbackUri) {
- this.fallbackUri = fallbackUri;
- }
-
- /**
- * flowRuleMaxQueueingTimeMs.
- *
- * @return FlowRuleMaxQueueingTimeMs flow rule max queueing time ms
- */
- public int getFlowRuleMaxQueueingTimeMs() {
- return flowRuleMaxQueueingTimeMs;
- }
-
- /**
- * set flowRuleMaxQueueingTimeMs.
- *
- * @param flowRuleMaxQueueingTimeMs flowRuleMaxQueueingTimeMs
- */
- public void setFlowRuleMaxQueueingTimeMs(final int flowRuleMaxQueueingTimeMs) {
- this.flowRuleMaxQueueingTimeMs = flowRuleMaxQueueingTimeMs;
- }
-
- /**
- * flowRuleWarmUpPeriodSec.
- *
- * @return FlowRuleWarmUpPeriodSec flow rule warm up period sec
- */
- public int getFlowRuleWarmUpPeriodSec() {
- return flowRuleWarmUpPeriodSec;
- }
-
- /**
- * set flowRuleWarmUpPeriodSec.
- *
- * @param flowRuleWarmUpPeriodSec flowRuleWarmUpPeriodSec
- */
- public void setFlowRuleWarmUpPeriodSec(final int flowRuleWarmUpPeriodSec) {
- this.flowRuleWarmUpPeriodSec = flowRuleWarmUpPeriodSec;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- SentinelHandle that = (SentinelHandle) o;
- return degradeRuleStatIntervals == that.degradeRuleStatIntervals && Objects.equals(flowRuleEnable, that.flowRuleEnable)
- && Objects.equals(flowRuleGrade, that.flowRuleGrade) && Objects.equals(flowRuleCount, that.flowRuleCount)
- && Objects.equals(flowRuleControlBehavior, that.flowRuleControlBehavior) && Objects.equals(degradeRuleEnable, that.degradeRuleEnable)
- && Objects.equals(degradeRuleGrade, that.degradeRuleGrade) && Objects.equals(degradeRuleCount, that.degradeRuleCount)
- && Objects.equals(degradeRuleTimeWindow, that.degradeRuleTimeWindow) && Objects.equals(degradeRuleMinRequestAmount, that.degradeRuleMinRequestAmount)
- && Objects.equals(degradeRuleSlowRatioThreshold, that.degradeRuleSlowRatioThreshold) && Objects.equals(fallbackUri, that.fallbackUri)
- && Objects.equals(flowRuleMaxQueueingTimeMs, that.flowRuleMaxQueueingTimeMs) && Objects.equals(flowRuleWarmUpPeriodSec, that.flowRuleWarmUpPeriodSec);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(flowRuleEnable, flowRuleGrade, flowRuleCount, flowRuleControlBehavior, degradeRuleEnable, degradeRuleGrade,
- degradeRuleCount, degradeRuleTimeWindow, degradeRuleMinRequestAmount, degradeRuleSlowRatioThreshold, degradeRuleStatIntervals,
- fallbackUri, flowRuleMaxQueueingTimeMs, flowRuleWarmUpPeriodSec);
- }
-
- @Override
- public String toString() {
- return "SentinelHandle{"
- + "flowRuleEnable="
- + flowRuleEnable
- + ", flowRuleGrade="
- + flowRuleGrade
- + ", flowRuleCount="
- + flowRuleCount
- + ", flowRuleControlBehavior="
- + flowRuleControlBehavior
- + ", degradeRuleEnable="
- + degradeRuleEnable
- + ", degradeRuleGrade="
- + degradeRuleGrade
- + ", degradeRuleCount="
- + degradeRuleCount
- + ", degradeRuleTimeWindow="
- + degradeRuleTimeWindow
- + ", degradeRuleMinRequestAmount="
- + degradeRuleMinRequestAmount
- + ", degradeRuleSlowRatioThreshold="
- + degradeRuleSlowRatioThreshold
- + ", degradeRuleStatIntervals="
- + degradeRuleStatIntervals
- + ", fallbackUri='"
- + fallbackUri
- + ", flowRuleMaxQueueingTimeMs='"
- + flowRuleMaxQueueingTimeMs
- + ", flowRuleWarmUpPeriodSec='"
- + flowRuleWarmUpPeriodSec
- + '\''
- + '}';
- }
-
- /**
- * check filed default value.
- */
- public void checkData() {
- this.setFlowRuleEnable((this.getFlowRuleEnable() == Constants.FLOW_RULE_ENABLE_ON || this.getFlowRuleEnable() == Constants.FLOW_RULE_ENABLE_OFF)
- ? this.getFlowRuleEnable() : Constants.SENTINEL_ENABLE_FLOW_RULE);
- this.setDegradeRuleEnable((this.getDegradeRuleEnable() == Constants.DEGRADE_RULE_ENABLE_ON || this.getDegradeRuleEnable() == Constants.DEGRADE_RULE_ENABLE_OFF)
- ? this.getDegradeRuleEnable() : Constants.SENTINEL_ENABLE_DEGRADE_RULE);
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/WafHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/WafHandle.java
deleted file mode 100644
index 873dad6..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/WafHandle.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule;
-
-import org.apache.shenyu.common.enums.WafEnum;
-
-import java.util.Objects;
-
-/**
- * this is waf plugin handle.
- */
-public class WafHandle {
-
- /**
- * permission.
- */
- private String permission;
-
- /**
- * statusCode.
- */
- private String statusCode;
-
- /**
- * New default instance waf handle.
- *
- * @return the waf handle
- */
- public static WafHandle newDefaultInstance() {
- WafHandle wafHandle = new WafHandle();
- wafHandle.setPermission(WafEnum.REJECT.getName());
- wafHandle.setStatusCode("403");
- return wafHandle;
- }
-
- /**
- * get permission.
- *
- * @return permission permission
- */
- public String getPermission() {
- return permission;
- }
-
- /**
- * set permission.
- *
- * @param permission permission
- */
- public void setPermission(final String permission) {
- this.permission = permission;
- }
-
- /**
- * get statusCode.
- *
- * @return statusCode status code
- */
- public String getStatusCode() {
- return statusCode;
- }
-
- /**
- * set statusCode.
- *
- * @param statusCode statusCode
- */
- public void setStatusCode(final String statusCode) {
- this.statusCode = statusCode;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- WafHandle wafHandle = (WafHandle) o;
- return Objects.equals(permission, wafHandle.permission) && Objects.equals(statusCode, wafHandle.statusCode);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(permission, statusCode);
- }
-
- @Override
- public String toString() {
- return "WafHandle{"
- + "permission='"
- + permission
- + '\''
- + ", statusCode='"
- + statusCode
- + '\''
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/CacheRuleHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/CacheRuleHandle.java
deleted file mode 100644
index 4d8a09e..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/CacheRuleHandle.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule.impl;
-
-import org.apache.shenyu.common.dto.convert.rule.RuleHandle;
-
-/**
- * The type Divide rule handle.
- */
-public class CacheRuleHandle implements RuleHandle {
-
- /**
- * the cache timeout seconds.
- */
- private Long timeoutSeconds = 60L;
-
- /**
- * Get the timeout seconds.
- *
- * @return the timeout seconds
- */
- public Long getTimeoutSeconds() {
- return timeoutSeconds;
- }
-
- /**
- * Set timeout seconds.
- *
- * @param timeoutSeconds the timeout seconds
- */
- public void setTimeoutSeconds(final Long timeoutSeconds) {
- this.timeoutSeconds = timeoutSeconds;
- }
-
- /**
- * New instance cache rule handle.
- *
- * @return the cache rule handle
- */
- public static CacheRuleHandle newInstance() {
- return new CacheRuleHandle();
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/ContextMappingRuleHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/ContextMappingRuleHandle.java
deleted file mode 100644
index 4d138bb..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/ContextMappingRuleHandle.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule.impl;
-
-import org.apache.shenyu.common.dto.convert.rule.RuleHandle;
-
-import java.util.Objects;
-
-/**
- * Context mapping thread handle.
- */
-public class ContextMappingRuleHandle implements RuleHandle {
-
- private boolean addPrefixed;
-
- private String contextPath;
-
- private String addPrefix;
-
- private String rewriteContextPath;
-
- /**
- * percentage of rewritten traffic in context.
- */
- private Integer percentage;
-
- /**
- * New instance context mapping rule handle.
- *
- * @return the context mapping rule handle
- */
- public static ContextMappingRuleHandle newInstance() {
- return new ContextMappingRuleHandle();
- }
-
- /**
- * get prefix forward status.
- *
- * @return prefix -forward status
- */
- public boolean getAddPrefixed() {
- return addPrefixed;
- }
-
- /**
- * set prefix forward.
- *
- * @param addPrefixed status
- */
- public void setAddPrefixed(final boolean addPrefixed) {
- this.addPrefixed = addPrefixed;
- }
-
- /**
- * get contextPath.
- *
- * @return contextPath context path
- */
- public String getContextPath() {
- return contextPath;
- }
-
- /**
- * set contextPath.
- *
- * @param contextPath contextPath
- */
- public void setContextPath(final String contextPath) {
- this.contextPath = contextPath;
- }
-
- /**
- * get addPrefix.
- *
- * @return addPrefix add prefix
- */
- public String getAddPrefix() {
- return addPrefix;
- }
-
- /**
- * set addPrefix.
- *
- * @param addPrefix addPrefix
- */
- public void setAddPrefix(final String addPrefix) {
- this.addPrefix = addPrefix;
- }
-
- /**
- * get rewrite context path.
- *
- * @return rewrite context path
- */
- public String getRewriteContextPath() {
- return rewriteContextPath;
- }
-
- /**
- * set rewrite context path.
- *
- * @param rewriteContextPath rewrite context path
- */
- public void setRewriteContextPath(final String rewriteContextPath) {
- this.rewriteContextPath = rewriteContextPath;
- }
-
- /**
- * get percentage.
- *
- * @return percentage
- */
- public Integer getPercentage() {
- return percentage;
- }
-
- /**
- * set percentage.
- *
- * @param percentage percentage
- */
- public void setPercentage(final Integer percentage) {
- this.percentage = percentage;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- ContextMappingRuleHandle that = (ContextMappingRuleHandle) o;
- return Objects.equals(contextPath, that.contextPath) && Objects.equals(addPrefix, that.addPrefix)
- && Objects.equals(addPrefixed, that.addPrefixed) && Objects.equals(rewriteContextPath, that.rewriteContextPath);
- }
-
- @Override
- public String toString() {
- return "ContextMappingRuleHandle{"
- + "contextPath='"
- + contextPath
- + '\''
- + ", addPrefix='"
- + addPrefix
- + '\''
- + "addPrefixed='"
- + addPrefixed
- + '\''
- + ", rewriteContextPath='"
- + rewriteContextPath
- + '\''
- + ", percentage='"
- + percentage
- + '\''
- + '}';
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(contextPath, addPrefix, addPrefixed, rewriteContextPath);
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/DivideRuleHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/DivideRuleHandle.java
deleted file mode 100644
index 20b1864..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/DivideRuleHandle.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule.impl;
-
-import org.apache.shenyu.common.constant.Constants;
-import org.apache.shenyu.common.dto.convert.rule.RuleHandle;
-import org.apache.shenyu.common.enums.LoadBalanceEnum;
-import org.apache.shenyu.common.enums.RetryEnum;
-
-import java.util.Objects;
-
-/**
- * The type Divide rule handle.
- */
-public class DivideRuleHandle implements RuleHandle {
-
- /**
- * loadBalance.
- * {@linkplain LoadBalanceEnum}
- */
- private String loadBalance = LoadBalanceEnum.RANDOM.getName();
-
- /**
- * retryStrategy.
- * {@linkplain RetryEnum}
- */
- private String retryStrategy = RetryEnum.CURRENT.getName();
-
- /**
- * http retry.
- */
- private int retry = 3;
-
- /**
- * timeout is required.
- */
- private long timeout = Constants.TIME_OUT;
-
- /**
- * headerMaxSize.
- */
- private long headerMaxSize;
-
- /**
- * requestMaxSize.
- */
- private long requestMaxSize;
-
- /**
- * New instance divide rule handle.
- *
- * @return the divide rule handle
- */
- public static DivideRuleHandle newInstance() {
- return new DivideRuleHandle();
- }
-
- /**
- * get loadBalance.
- *
- * @return loadBalance load balance
- */
- public String getLoadBalance() {
- return loadBalance;
- }
-
- /**
- * set loadBalance.
- *
- * @param loadBalance loadBalance
- */
- public void setLoadBalance(final String loadBalance) {
- this.loadBalance = loadBalance;
- }
-
- /**
- * get retryStrategy.
- *
- * @return retryStrategy retry strategy
- */
- public String getRetryStrategy() {
- return retryStrategy;
- }
-
- /**
- * set retryStrategy.
- *
- * @param retryStrategy retryStrategy
- */
- public void setRetryStrategy(final String retryStrategy) {
- this.retryStrategy = retryStrategy;
- }
-
- /**
- * get retry.
- *
- * @return retry retry
- */
- public int getRetry() {
- return retry;
- }
-
- /**
- * set retry.
- *
- * @param retry retry
- */
- public void setRetry(final int retry) {
- this.retry = retry;
- }
-
- /**
- * get timeout.
- *
- * @return timeout timeout
- */
- public long getTimeout() {
- return timeout;
- }
-
- /**
- * set timeout.
- *
- * @param timeout timeout
- */
- public void setTimeout(final long timeout) {
- this.timeout = timeout;
- }
-
- /**
- * get headerMaxSize.
- *
- * @return headerMaxSize header max size
- */
- public long getHeaderMaxSize() {
- return headerMaxSize;
- }
-
- /**
- * set headerMaxSize.
- *
- * @param headerMaxSize headerMaxSize
- */
- public void setHeaderMaxSize(final long headerMaxSize) {
- this.headerMaxSize = headerMaxSize;
- }
-
- /**
- * get requestMaxSize.
- *
- * @return requestMaxSize request max size
- */
- public long getRequestMaxSize() {
- return requestMaxSize;
- }
-
- /**
- * set requestMaxSize.
- *
- * @param requestMaxSize requestMaxSize
- */
- public void setRequestMaxSize(final long requestMaxSize) {
- this.requestMaxSize = requestMaxSize;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- DivideRuleHandle that = (DivideRuleHandle) o;
- return retry == that.retry && timeout == that.timeout && headerMaxSize == that.headerMaxSize
- && requestMaxSize == that.requestMaxSize && Objects.equals(loadBalance, that.loadBalance)
- && Objects.equals(retryStrategy, that.retryStrategy);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(loadBalance, retryStrategy, retry, timeout, headerMaxSize, requestMaxSize);
- }
-
- @Override
- public String toString() {
- return "DivideRuleHandle{"
- + "loadBalance='"
- + loadBalance
- + '\''
- + "retryStrategy='"
- + retryStrategy
- + '\''
- + ", retry="
- + retry
- + ", timeout="
- + timeout
- + ", headerMaxSize="
- + headerMaxSize
- + ", requestMaxSize="
- + requestMaxSize
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/DubboRuleHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/DubboRuleHandle.java
deleted file mode 100644
index ec31321..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/DubboRuleHandle.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule.impl;
-
-import org.apache.shenyu.common.constant.Constants;
-import org.apache.shenyu.common.dto.convert.rule.RuleHandle;
-import org.apache.shenyu.common.enums.LoadBalanceEnum;
-
-import java.util.Objects;
-
-/**
- * The type Dubbo rule handle.
- */
-public class DubboRuleHandle implements RuleHandle {
-
- /**
- * version.
- */
- private String version;
-
- /**
- * group.
- */
- private String group;
-
- /**
- * retries.
- */
- private Integer retries = 0;
-
- /**
- * the loadbalance.
- * {@linkplain LoadBalanceEnum}
- */
- private String loadBalance = LoadBalanceEnum.RANDOM.getName();
-
- /**
- * timeout is required.
- */
- private long timeout = Constants.TIME_OUT;
-
- /**
- * New instance dubbo rule handle.
- *
- * @return the dubbo rule handle
- */
- public static DubboRuleHandle newInstance() {
- return new DubboRuleHandle();
- }
-
- /**
- * get version.
- *
- * @return version version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * set version.
- *
- * @param version version
- */
- public void setVersion(final String version) {
- this.version = version;
- }
-
- /**
- * get group.
- *
- * @return group group
- */
- public String getGroup() {
- return group;
- }
-
- /**
- * set group.
- *
- * @param group group
- */
- public void setGroup(final String group) {
- this.group = group;
- }
-
- /**
- * get retries.
- *
- * @return retries retries
- */
- public Integer getRetries() {
- return retries;
- }
-
- /**
- * set retries.
- *
- * @param retries retries
- */
- public void setRetries(final Integer retries) {
- this.retries = retries;
- }
-
- /**
- * Gets the value of loadbalance.
- *
- * @return the value of loadbalance
- */
- public String getLoadBalance() {
- return loadBalance;
- }
-
- /**
- * Sets the loadbalance.
- *
- * @param loadBalance loadbalance
- */
- public void setLoadBalance(final String loadBalance) {
- this.loadBalance = loadBalance;
- }
-
- /**
- * get timeout.
- *
- * @return timeout timeout
- */
- public long getTimeout() {
- return timeout;
- }
-
- /**
- * set timeout.
- *
- * @param timeout timeout
- */
- public void setTimeout(final long timeout) {
- this.timeout = timeout;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof DubboRuleHandle)) {
- return false;
- }
- DubboRuleHandle that = (DubboRuleHandle) o;
- return timeout == that.timeout
- && Objects.equals(version, that.version)
- && Objects.equals(group, that.group)
- && Objects.equals(retries, that.retries)
- && Objects.equals(loadBalance, that.loadBalance);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(version, group, retries, loadBalance, timeout);
- }
-
- @Override
- public String toString() {
- return "DubboRuleHandle{"
- + "version='" + version + '\''
- + ", group='" + group + '\''
- + ", retries=" + retries
- + ", loadbalance='" + loadBalance + '\''
- + ", timeout=" + timeout
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/GrpcRuleHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/GrpcRuleHandle.java
deleted file mode 100644
index 2fa8a8f..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/GrpcRuleHandle.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule.impl;
-
-import org.apache.shenyu.common.dto.convert.rule.RuleHandle;
-import org.apache.shenyu.common.enums.LoadBalanceEnum;
-
-import java.util.Objects;
-
-/**
- * The type Grpc rule handle.
- */
-public class GrpcRuleHandle implements RuleHandle {
-
- /**
- * the loadBalance.
- * {@linkplain LoadBalanceEnum}
- */
- private String loadBalance = LoadBalanceEnum.RANDOM.getName();
-
- /**
- * New instance Grpc rule handle.
- *
- * @return the Grpc rule handle
- */
- public static GrpcRuleHandle newInstance() {
- return new GrpcRuleHandle();
- }
-
- /**
- * Gets the value of loadBalance.
- *
- * @return the value of loadBalance
- */
- public String getLoadBalance() {
- return loadBalance;
- }
-
- /**
- * Sets the loadBalance.
- *
- * @param loadBalance loadBalance
- */
- public void setLoadBalance(final String loadBalance) {
- this.loadBalance = loadBalance;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof GrpcRuleHandle)) {
- return false;
- }
- GrpcRuleHandle that = (GrpcRuleHandle) o;
- return Objects.equals(loadBalance, that.loadBalance);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(loadBalance);
- }
-
- @Override
- public String toString() {
- return "GrpcRuleHandle{"
- + "loadBalance='" + loadBalance + '\''
- + '}';
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/KeyAuthRuleHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/KeyAuthRuleHandle.java
deleted file mode 100644
index b360a80..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/KeyAuthRuleHandle.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule.impl;
-
-import org.apache.shenyu.common.dto.convert.rule.RuleHandle;
-
-import java.util.Objects;
-
-/**
- * Key-Auth rule handle.
- */
-public class KeyAuthRuleHandle implements RuleHandle {
-
- /**
- * The key attribute name. It is required.
- */
- private String keyName;
-
- /**
- * The key value. It is required.
- */
- private String key;
-
- /**
- * Get key attribute name.
- *
- * @return keyName
- */
- public String getKeyName() {
- return keyName;
- }
-
- /**
- * Set key attribute name.
- *
- * @param keyName keyName
- */
- public void setKeyName(final String keyName) {
- this.keyName = keyName;
- }
-
- /**
- * Get the key.
- *
- * @return key
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Set the key.
- *
- * @param key key
- */
- public void setKey(final String key) {
- this.key = key;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (Objects.isNull(o) || getClass() != o.getClass()) {
- return false;
- }
- KeyAuthRuleHandle that = (KeyAuthRuleHandle) o;
- return Objects.equals(keyName, that.keyName)
- && Objects.equals(key, that.key);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(keyName, key);
- }
-
- @Override
- public String toString() {
- return "KeyAuthRuleHandle{"
- + "keyName='" + keyName
- + "', key='" + key
- + "'}";
- }
-}
diff --git a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/ModifyResponseRuleHandle.java b/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/ModifyResponseRuleHandle.java
deleted file mode 100644
index b76aebc..0000000
--- a/shenyu-java-common/src/main/java/org/apache/shenyu/common/dto/convert/rule/impl/ModifyResponseRuleHandle.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shenyu.common.dto.convert.rule.impl;
-
-import org.apache.shenyu.common.dto.convert.rule.RuleHandle;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-
-/**
- * The type ModifyResponse rule handle.
- */
-public class ModifyResponseRuleHandle implements RuleHandle {
-
- /**
- * add header map.
- */
- private Map addHeaders;
-
- /**
- * set header map.
- */
- private Map setHeaders;
-
- /**
- * replace header map
- * key: oldHeaderKey, value: newHeaderKey.
- */
- private Map