diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthorityRuleController.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthorityRuleController.java index 867c01d6..fc8b07b9 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthorityRuleController.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthorityRuleController.java @@ -23,7 +23,7 @@ import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.auth.AuthService.PrivilegeType; -import com.alibaba.csp.sentinel.dashboard.rule.publisher.AuthorityRuleNacosPublisher; +import com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher.AuthorityRuleNacosPublisher; import com.alibaba.csp.sentinel.slots.block.RuleConstant; import com.alibaba.csp.sentinel.util.StringUtil; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/DegradeController.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/DegradeController.java index a664f930..e216813c 100755 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/DegradeController.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/DegradeController.java @@ -24,7 +24,7 @@ import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.auth.AuthService.PrivilegeType; import com.alibaba.csp.sentinel.dashboard.repository.rule.RuleRepository; -import com.alibaba.csp.sentinel.dashboard.rule.publisher.DegradeRuleNacosPublisher; +import com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher.DegradeRuleNacosPublisher; import com.alibaba.csp.sentinel.slots.block.RuleConstant; import com.alibaba.csp.sentinel.slots.block.degrade.circuitbreaker.CircuitBreakerStrategy; import com.alibaba.csp.sentinel.util.StringUtil; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/FlowControllerV1.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/FlowControllerV1.java index 47788636..60003882 100755 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/FlowControllerV1.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/FlowControllerV1.java @@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit; import com.alibaba.csp.sentinel.dashboard.auth.AuthAction; import com.alibaba.csp.sentinel.dashboard.auth.AuthService.PrivilegeType; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; -import com.alibaba.csp.sentinel.dashboard.rule.publisher.FlowRuleNacosPublisher; +import com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher.FlowRuleNacosPublisher; import com.alibaba.csp.sentinel.util.StringUtil; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/ParamFlowRuleController.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/ParamFlowRuleController.java index 63391af1..411c6b96 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/ParamFlowRuleController.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/ParamFlowRuleController.java @@ -28,7 +28,7 @@ import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.auth.AuthService; import com.alibaba.csp.sentinel.dashboard.auth.AuthService.PrivilegeType; -import com.alibaba.csp.sentinel.dashboard.rule.publisher.ParamRuleNacosPublisher; +import com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher.ParamRuleNacosPublisher; import com.alibaba.csp.sentinel.slots.block.RuleConstant; import com.alibaba.csp.sentinel.util.StringUtil; import com.alibaba.csp.sentinel.dashboard.datasource.entity.SentinelVersion; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/SystemController.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/SystemController.java index 25edf997..79214194 100755 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/SystemController.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/SystemController.java @@ -22,7 +22,7 @@ import com.alibaba.csp.sentinel.dashboard.auth.AuthAction; import com.alibaba.csp.sentinel.dashboard.auth.AuthService.PrivilegeType; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.repository.rule.RuleRepository; -import com.alibaba.csp.sentinel.dashboard.rule.publisher.SystemRuleNacosPublisher; +import com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher.SystemRuleNacosPublisher; import com.alibaba.csp.sentinel.util.StringUtil; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.SystemRuleEntity; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayApiController.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayApiController.java index 493ba06b..edc1c064 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayApiController.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayApiController.java @@ -26,8 +26,7 @@ import com.alibaba.csp.sentinel.dashboard.domain.vo.gateway.api.AddApiReqVo; import com.alibaba.csp.sentinel.dashboard.domain.vo.gateway.api.ApiPredicateItemVo; import com.alibaba.csp.sentinel.dashboard.domain.vo.gateway.api.UpdateApiReqVo; import com.alibaba.csp.sentinel.dashboard.repository.gateway.InMemApiDefinitionStore; -import com.alibaba.csp.sentinel.dashboard.rule.publisher.ApiDefinitionNacosPublisher; -import com.alibaba.csp.sentinel.dashboard.rule.publisher.AuthorityRuleNacosPublisher; +import com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher.ApiDefinitionNacosPublisher; import com.alibaba.csp.sentinel.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayFlowRuleController.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayFlowRuleController.java index fc196a5b..72149e1e 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayFlowRuleController.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayFlowRuleController.java @@ -27,8 +27,7 @@ import com.alibaba.csp.sentinel.dashboard.domain.vo.gateway.rule.AddFlowRuleReqV import com.alibaba.csp.sentinel.dashboard.domain.vo.gateway.rule.GatewayParamFlowItemVo; import com.alibaba.csp.sentinel.dashboard.domain.vo.gateway.rule.UpdateFlowRuleReqVo; import com.alibaba.csp.sentinel.dashboard.repository.gateway.InMemGatewayFlowRuleStore; -import com.alibaba.csp.sentinel.dashboard.rule.publisher.ApiDefinitionNacosPublisher; -import com.alibaba.csp.sentinel.dashboard.rule.publisher.GatewayRuleNacosPublisher; +import com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher.GatewayRuleNacosPublisher; import com.alibaba.csp.sentinel.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/Converters.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/Converters.java index 049f9c39..11c3c9b7 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/Converters.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/Converters.java @@ -13,7 +13,7 @@ import java.util.List; @Component public class Converters { - /***************** API Start ******************/ + // 网关API定义规则 @Bean public Converter, String> apiRuleEntityEncoder() { return JSON::toJSONString; @@ -23,9 +23,8 @@ public class Converters { public Converter> apiEntityDecoder() { return s -> JSON.parseArray(s, ApiDefinitionEntity.class); } - /***************** API End ******************/ - /***************** Gateway Start ******************/ + // 网关流控规则 @Bean public Converter, String> gatewayRuleEntityEncoder() { return JSON::toJSONString; @@ -35,9 +34,8 @@ public class Converters { public Converter> gatewayRuleEntityDecoder() { return s -> JSON.parseArray(s, GatewayFlowRuleEntity.class); } - /***************** Gateway End ******************/ - /***************** System Start ******************/ + // 授权规则 @Bean public Converter, String> authorityRuleEntityEncoder() { return JSON::toJSONString; @@ -47,10 +45,8 @@ public class Converters { public Converter> authorityRuleEntityDecoder() { return s -> JSON.parseArray(s, AuthorityRuleEntity.class); } - /***************** System End ******************/ - - /***************** System Start ******************/ + // 熔断规则 @Bean public Converter, String> degradeRuleEntityEncoder() { return JSON::toJSONString; @@ -60,10 +56,8 @@ public class Converters { public Converter> degradeRuleEntityDecoder() { return s -> JSON.parseArray(s, DegradeRuleEntity.class); } - /***************** System End ******************/ - - /***************** System Start ******************/ + // 系统规则 @Bean public Converter, String> systemRuleEntityEncoder() { return JSON::toJSONString; @@ -73,10 +67,8 @@ public class Converters { public Converter> systemRuleEntityDecoder() { return s -> JSON.parseArray(s, SystemRuleEntity.class); } - /***************** System End ******************/ - - /***************** Param Start ******************/ + // 热点参数规则 @Bean public Converter, String> paramRuleEntityEncoder() { return JSON::toJSONString; @@ -86,10 +78,8 @@ public class Converters { public Converter> paramRuleEntityDecoder() { return s -> JSON.parseArray(s, ParamFlowRuleEntity.class); } - /***************** Param End ******************/ - - /***************** Flow Start ******************/ + // 流控规则 @Bean public Converter, String> flowRuleEntityEncoder() { return JSON::toJSONString; @@ -99,7 +89,4 @@ public class Converters { public Converter> flowRuleEntityDecoder() { return s -> JSON.parseArray(s, FlowRuleEntity.class); } - - /***************** Flow End ******************/ - } diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/api/ApiDefinitionApiProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/ApiDefinitionApiProvider.java similarity index 67% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/api/ApiDefinitionApiProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/ApiDefinitionApiProvider.java index a2f88295..ec00eaf5 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/api/ApiDefinitionApiProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/ApiDefinitionApiProvider.java @@ -1,23 +1,7 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.api; +package com.alibaba.csp.sentinel.dashboard.rule.apiProvider; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.ApiDefinitionEntity; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRuleProvider; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/auth/AuthorityRuleApiProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/AuthorityRuleApiProvider.java similarity index 60% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/auth/AuthorityRuleApiProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/AuthorityRuleApiProvider.java index d80225b5..c9bbcd47 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/auth/AuthorityRuleApiProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/AuthorityRuleApiProvider.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.auth; +package com.alibaba.csp.sentinel.dashboard.rule.apiProvider; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.AuthorityRuleEntity; @@ -28,7 +13,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -@Component("authorityRuleDefaultProvider") +@Component public class AuthorityRuleApiProvider implements DynamicRuleProvider> { @Autowired @@ -42,9 +27,9 @@ public class AuthorityRuleApiProvider implements DynamicRuleProvider(); } List list = appManagement.getDetailApp(appName).getMachines() - .stream() - .filter(MachineInfo::isHealthy) - .sorted((e1, e2) -> Long.compare(e2.getLastHeartbeat(), e1.getLastHeartbeat())).collect(Collectors.toList()); + .stream() + .filter(MachineInfo::isHealthy) + .sorted((e1, e2) -> Long.compare(e2.getLastHeartbeat(), e1.getLastHeartbeat())).collect(Collectors.toList()); if (list.isEmpty()) { return new ArrayList<>(); } else { diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/degrade/DegradeRuleApiProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/DegradeRuleApiProvider.java similarity index 65% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/degrade/DegradeRuleApiProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/DegradeRuleApiProvider.java index 78989e24..198a3c7c 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/degrade/DegradeRuleApiProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/DegradeRuleApiProvider.java @@ -1,23 +1,7 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.degrade; +package com.alibaba.csp.sentinel.dashboard.rule.apiProvider; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.ParamFlowRuleEntity; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRuleProvider; @@ -29,7 +13,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -@Component("degradeRuleDefaultProvider") +@Component public class DegradeRuleApiProvider implements DynamicRuleProvider> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/flow/FlowRuleApiProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/FlowRuleApiProvider.java similarity index 67% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/flow/FlowRuleApiProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/FlowRuleApiProvider.java index 36e50593..1e5a82dc 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/flow/FlowRuleApiProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/FlowRuleApiProvider.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.flow; +package com.alibaba.csp.sentinel.dashboard.rule.apiProvider; import java.util.ArrayList; import java.util.List; @@ -30,10 +15,7 @@ import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -/** - * @author Eric Zhao - */ -@Component("flowRuleDefaultProvider") +@Component public class FlowRuleApiProvider implements DynamicRuleProvider> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/gateway/GatewayRuleApiProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/GatewayRuleApiProvider.java similarity index 66% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/gateway/GatewayRuleApiProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/GatewayRuleApiProvider.java index 6f2a8e5d..101ea358 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/gateway/GatewayRuleApiProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/GatewayRuleApiProvider.java @@ -1,23 +1,7 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.gateway; +package com.alibaba.csp.sentinel.dashboard.rule.apiProvider; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.GatewayFlowRuleEntity; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRuleProvider; @@ -29,7 +13,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -@Component("gatewayRuleDefaultProvider") +@Component public class GatewayRuleApiProvider implements DynamicRuleProvider> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/param/ParamRuleApiProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/ParamRuleApiProvider.java similarity index 62% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/param/ParamRuleApiProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/ParamRuleApiProvider.java index 262e9174..d2adfa9e 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/param/ParamRuleApiProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/ParamRuleApiProvider.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.param; +package com.alibaba.csp.sentinel.dashboard.rule.apiProvider; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.ParamFlowRuleEntity; @@ -28,7 +13,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -@Component("paramRuleDefaultProvider") +@Component public class ParamRuleApiProvider implements DynamicRuleProvider> { @Autowired @@ -49,11 +34,7 @@ public class ParamRuleApiProvider implements DynamicRuleProvider(); } else { MachineInfo machine = list.get(0); -// return sentinelApiClient.fetchFlowRuleOfMachine(machine.getApp(), machine.getIp(), machine.getPort()); return sentinelApiClient.fetchParamFlowRulesOfMachine(machine.getApp(), machine.getIp(), machine.getPort()) -// .thenApply(repository::saveAll) -// .thenApply(Result::ofSuccess) -// .get() .get(); } } diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/system/SystemRuleApiProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/SystemRuleApiProvider.java similarity index 68% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/system/SystemRuleApiProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/SystemRuleApiProvider.java index 5fc56fac..60c4a056 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/system/SystemRuleApiProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiProvider/SystemRuleApiProvider.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.system; +package com.alibaba.csp.sentinel.dashboard.rule.apiProvider; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.SystemRuleEntity; @@ -28,7 +13,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -@Component("systemRuleDefaultProvider") +@Component public class SystemRuleApiProvider implements DynamicRuleProvider> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/api/ApiDefinitionApiPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/ApiDefinitionApiPublisher.java similarity index 64% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/api/ApiDefinitionApiPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/ApiDefinitionApiPublisher.java index 538fd3f3..4cce84d0 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/api/ApiDefinitionApiPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/ApiDefinitionApiPublisher.java @@ -1,23 +1,7 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.api; +package com.alibaba.csp.sentinel.dashboard.rule.apiPublisher; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.ApiDefinitionEntity; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRulePublisher; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/auth/AuthorityRuleApiPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/AuthorityRuleApiPublisher.java similarity index 62% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/auth/AuthorityRuleApiPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/AuthorityRuleApiPublisher.java index c3894bfb..a7b59137 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/auth/AuthorityRuleApiPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/AuthorityRuleApiPublisher.java @@ -1,23 +1,7 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.auth; +package com.alibaba.csp.sentinel.dashboard.rule.apiPublisher; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.AuthorityRuleEntity; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRulePublisher; @@ -28,11 +12,7 @@ import org.springframework.stereotype.Component; import java.util.List; import java.util.Set; -/** - * @author Eric Zhao - * @since 1.4.0 - */ -@Component("authorityRuleDefaultPublisher") +@Component public class AuthorityRuleApiPublisher implements DynamicRulePublisher> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/degrade/DegradeRuleApiPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/DegradeRuleApiPublisher.java similarity index 64% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/degrade/DegradeRuleApiPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/DegradeRuleApiPublisher.java index 2bd1db70..ea49947d 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/degrade/DegradeRuleApiPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/DegradeRuleApiPublisher.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.degrade; +package com.alibaba.csp.sentinel.dashboard.rule.apiPublisher; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; @@ -27,11 +12,7 @@ import org.springframework.stereotype.Component; import java.util.List; import java.util.Set; -/** - * @author Eric Zhao - * @since 1.4.0 - */ -@Component("degradeRuleDefaultPublisher") +@Component public class DegradeRuleApiPublisher implements DynamicRulePublisher> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/flow/FlowRuleApiPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/FlowRuleApiPublisher.java similarity index 64% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/flow/FlowRuleApiPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/FlowRuleApiPublisher.java index eae1e989..2a89c406 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/flow/FlowRuleApiPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/FlowRuleApiPublisher.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.flow; +package com.alibaba.csp.sentinel.dashboard.rule.apiPublisher; import java.util.List; import java.util.Set; @@ -28,11 +13,7 @@ import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -/** - * @author Eric Zhao - * @since 1.4.0 - */ -@Component("flowRuleDefaultPublisher") +@Component public class FlowRuleApiPublisher implements DynamicRulePublisher> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/gateway/GatewayRuleApiPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/GatewayRuleApiPublisher.java similarity index 62% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/gateway/GatewayRuleApiPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/GatewayRuleApiPublisher.java index 4780e729..1faffd75 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/gateway/GatewayRuleApiPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/GatewayRuleApiPublisher.java @@ -1,23 +1,7 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.gateway; +package com.alibaba.csp.sentinel.dashboard.rule.apiPublisher; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.GatewayFlowRuleEntity; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRulePublisher; @@ -28,11 +12,7 @@ import org.springframework.stereotype.Component; import java.util.List; import java.util.Set; -/** - * @author Eric Zhao - * @since 1.4.0 - */ -@Component("gatewayRuleDefaultPublisher") +@Component public class GatewayRuleApiPublisher implements DynamicRulePublisher> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/param/ParamRuleApiPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/ParamRuleApiPublisher.java similarity index 64% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/param/ParamRuleApiPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/ParamRuleApiPublisher.java index a2f581b1..ac25ed0c 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/param/ParamRuleApiPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/ParamRuleApiPublisher.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.param; +package com.alibaba.csp.sentinel.dashboard.rule.apiPublisher; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.ParamFlowRuleEntity; @@ -27,11 +12,7 @@ import org.springframework.stereotype.Component; import java.util.List; import java.util.Set; -/** - * @author Eric Zhao - * @since 1.4.0 - */ -@Component("paramRuleDefaultPublisher") +@Component public class ParamRuleApiPublisher implements DynamicRulePublisher> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/system/SystemRuleApiPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/SystemRuleApiPublisher.java similarity index 64% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/system/SystemRuleApiPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/SystemRuleApiPublisher.java index 82123168..97ced38e 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/system/SystemRuleApiPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/apiPublisher/SystemRuleApiPublisher.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.system; +package com.alibaba.csp.sentinel.dashboard.rule.apiPublisher; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.SystemRuleEntity; @@ -27,11 +12,7 @@ import org.springframework.stereotype.Component; import java.util.List; import java.util.Set; -/** - * @author Eric Zhao - * @since 1.4.0 - */ -@Component("systemRuleDefaultPublisher") +@Component public class SystemRuleApiPublisher implements DynamicRulePublisher> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/api/ApiDefinitionNacosProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/ApiDefinitionNacosProvider.java similarity index 63% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/api/ApiDefinitionNacosProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/ApiDefinitionNacosProvider.java index d3f0df92..dc362d3a 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/api/ApiDefinitionNacosProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/ApiDefinitionNacosProvider.java @@ -1,22 +1,6 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.api; +package com.alibaba.csp.sentinel.dashboard.rule.nacosProvider; import com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.ApiDefinitionEntity; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRuleProvider; import com.alibaba.csp.sentinel.dashboard.rule.nacos.NacosConfigUtil; import com.alibaba.csp.sentinel.datasource.Converter; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/auth/AuthorityRuleNacosProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/AuthorityRuleNacosProvider.java similarity index 63% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/auth/AuthorityRuleNacosProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/AuthorityRuleNacosProvider.java index abd04a64..e4ff8111 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/auth/AuthorityRuleNacosProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/AuthorityRuleNacosProvider.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.auth; +package com.alibaba.csp.sentinel.dashboard.rule.nacosProvider; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.AuthorityRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRuleProvider; @@ -27,11 +12,7 @@ import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; -/** - * @author Eric Zhao - * @since 1.4.0 - */ -@Component("authorityRuleNacosProvider") +@Component public class AuthorityRuleNacosProvider implements DynamicRuleProvider> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/degrade/DegradeRuleNacosProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/DegradeRuleNacosProvider.java similarity index 63% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/degrade/DegradeRuleNacosProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/DegradeRuleNacosProvider.java index ee80cf97..5d24bf8e 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/degrade/DegradeRuleNacosProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/DegradeRuleNacosProvider.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.degrade; +package com.alibaba.csp.sentinel.dashboard.rule.nacosProvider; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRuleProvider; @@ -27,11 +12,7 @@ import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; -/** - * @author Eric Zhao - * @since 1.4.0 - */ -@Component("degradeRuleNacosProvider") +@Component public class DegradeRuleNacosProvider implements DynamicRuleProvider> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/flow/FlowRuleNacosProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/FlowRuleNacosProvider.java similarity index 62% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/flow/FlowRuleNacosProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/FlowRuleNacosProvider.java index 79562d73..1989d673 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/flow/FlowRuleNacosProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/FlowRuleNacosProvider.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.flow; +package com.alibaba.csp.sentinel.dashboard.rule.nacosProvider; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRuleProvider; @@ -24,15 +9,10 @@ import com.alibaba.nacos.api.config.ConfigService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; -/** - * @author Eric Zhao - * @since 1.4.0 - */ -@Component("flowRuleNacosProvider") +@Component public class FlowRuleNacosProvider implements DynamicRuleProvider> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/gateway/GatewayRuleNacosProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/GatewayRuleNacosProvider.java similarity index 61% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/gateway/GatewayRuleNacosProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/GatewayRuleNacosProvider.java index c0b74337..acf90010 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/gateway/GatewayRuleNacosProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/GatewayRuleNacosProvider.java @@ -1,22 +1,6 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.gateway; +package com.alibaba.csp.sentinel.dashboard.rule.nacosProvider; import com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.GatewayFlowRuleEntity; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRuleProvider; import com.alibaba.csp.sentinel.dashboard.rule.nacos.NacosConfigUtil; import com.alibaba.csp.sentinel.datasource.Converter; @@ -28,11 +12,7 @@ import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; -/** - * @author Eric Zhao - * @since 1.4.0 - */ -@Component("gatewayRuleNacosProvider") +@Component public class GatewayRuleNacosProvider implements DynamicRuleProvider> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/param/ParamRuleNacosProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/ParamRuleNacosProvider.java similarity index 63% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/param/ParamRuleNacosProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/ParamRuleNacosProvider.java index c20e1086..f62f515e 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/param/ParamRuleNacosProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/ParamRuleNacosProvider.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.param; +package com.alibaba.csp.sentinel.dashboard.rule.nacosProvider; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.ParamFlowRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRuleProvider; @@ -27,11 +12,7 @@ import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; -/** - * @author Eric Zhao - * @since 1.4.0 - */ -@Component("paramRuleNacosProvider") +@Component public class ParamRuleNacosProvider implements DynamicRuleProvider> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/system/SystemRuleNacosProvider.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/SystemRuleNacosProvider.java similarity index 63% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/system/SystemRuleNacosProvider.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/SystemRuleNacosProvider.java index bca00f06..ceb73575 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/system/SystemRuleNacosProvider.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosProvider/SystemRuleNacosProvider.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.system; +package com.alibaba.csp.sentinel.dashboard.rule.nacosProvider; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.SystemRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRuleProvider; @@ -27,11 +12,7 @@ import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; -/** - * @author Eric Zhao - * @since 1.4.0 - */ -@Component("systemRuleNacosProvider") +@Component public class SystemRuleNacosProvider implements DynamicRuleProvider> { @Autowired diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/ApiDefinitionNacosPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/ApiDefinitionNacosPublisher.java similarity index 68% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/ApiDefinitionNacosPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/ApiDefinitionNacosPublisher.java index f3d35556..7e21dc3b 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/ApiDefinitionNacosPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/ApiDefinitionNacosPublisher.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.publisher; +package com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher; import com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.ApiDefinitionEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRulePublisher; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/AuthorityRuleNacosPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/AuthorityRuleNacosPublisher.java similarity index 74% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/AuthorityRuleNacosPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/AuthorityRuleNacosPublisher.java index e9ec5abb..84b5ce14 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/AuthorityRuleNacosPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/AuthorityRuleNacosPublisher.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.publisher; +package com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.AuthorityRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRulePublisher; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/DegradeRuleNacosPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/DegradeRuleNacosPublisher.java similarity index 68% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/DegradeRuleNacosPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/DegradeRuleNacosPublisher.java index 21e1df3a..012786f0 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/DegradeRuleNacosPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/DegradeRuleNacosPublisher.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.publisher; +package com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRulePublisher; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/FlowRuleNacosPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/FlowRuleNacosPublisher.java similarity index 68% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/FlowRuleNacosPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/FlowRuleNacosPublisher.java index 8c477ac6..84fbd853 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/FlowRuleNacosPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/FlowRuleNacosPublisher.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.publisher; +package com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRulePublisher; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/GatewayRuleNacosPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/GatewayRuleNacosPublisher.java similarity index 68% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/GatewayRuleNacosPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/GatewayRuleNacosPublisher.java index 95154004..76e81579 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/GatewayRuleNacosPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/GatewayRuleNacosPublisher.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.publisher; +package com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher; import com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.GatewayFlowRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRulePublisher; diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/ParamRuleNacosPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/ParamRuleNacosPublisher.java new file mode 100644 index 00000000..7c1b0fb9 --- /dev/null +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/ParamRuleNacosPublisher.java @@ -0,0 +1,59 @@ +package com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher; + +import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.ParamFlowRuleEntity; +import com.alibaba.csp.sentinel.dashboard.rule.DynamicRulePublisher; +import com.alibaba.csp.sentinel.dashboard.rule.nacos.NacosConfigUtil; +import com.alibaba.csp.sentinel.datasource.Converter; +import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule; +import com.alibaba.csp.sentinel.util.AssertUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.nacos.api.config.ConfigService; +import com.alibaba.nacos.api.config.ConfigType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Component +public class ParamRuleNacosPublisher implements DynamicRulePublisher> { + private static final Logger logger = LoggerFactory.getLogger(ParamRuleNacosPublisher.class); + + @Autowired + private ConfigService configService; + @Autowired + private Converter, String> converter; + + @Override + public void publish(String app, List rules) throws Exception { + AssertUtil.notEmpty(app, "app name cannot be empty"); + if (rules == null) { + return; + } + String dataId = NacosConfigUtil.getParamRuleDataId(app); + List collect = rules.stream().map(entity -> { + ParamFlowRule rule = new ParamFlowRule(); + rule.setResource(entity.getResource()); + rule.setLimitApp(entity.getLimitApp()); + rule.setGrade(entity.getGrade()); + rule.setCount(entity.getCount()); + rule.setDurationInSec(entity.getDurationInSec()); + rule.setParamIdx(entity.getParamIdx()); + rule.setControlBehavior(entity.getControlBehavior()); + rule.setMaxQueueingTimeMs(entity.getMaxQueueingTimeMs()); + rule.setBurstCount(entity.getBurstCount()); + + if (entity.getParamFlowItemList() != null) { + rule.setParamFlowItemList(new ArrayList<>(entity.getParamFlowItemList())); + } + + return rule; + }).collect(Collectors.toList()); + String convert = JSON.toJSONString(collect); + boolean status = configService.publishConfig(dataId, NacosConfigUtil.GROUP_ID, convert, ConfigType.JSON.getType()); + logger.info("配置文件:[{}],推送结果:[{}]", dataId, status); + } +} diff --git a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/SystemRuleNacosPublisher.java b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/SystemRuleNacosPublisher.java similarity index 68% rename from sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/SystemRuleNacosPublisher.java rename to sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/SystemRuleNacosPublisher.java index 62635a7d..e4d699c3 100644 --- a/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/publisher/SystemRuleNacosPublisher.java +++ b/sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/nacosPublisher/SystemRuleNacosPublisher.java @@ -1,19 +1,4 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed 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 com.alibaba.csp.sentinel.dashboard.rule.publisher; +package com.alibaba.csp.sentinel.dashboard.rule.nacosPublisher; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.SystemRuleEntity; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRulePublisher;