diff --git a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/RateLimiterConfiguration.java b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/RateLimiterConfiguration.java index 92558f63..a3c595c7 100755 --- a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/RateLimiterConfiguration.java +++ b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/RateLimiterConfiguration.java @@ -20,6 +20,7 @@ import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import reactor.core.publisher.Mono; + import java.util.Objects; /** diff --git a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/RouterFunctionConfiguration.java b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/RouterFunctionConfiguration.java index 87a68bbe..8d814c22 100755 --- a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/RouterFunctionConfiguration.java +++ b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/RouterFunctionConfiguration.java @@ -22,7 +22,10 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.server.*; +import org.springframework.web.reactive.function.server.RequestPredicates; +import org.springframework.web.reactive.function.server.RouterFunction; +import org.springframework.web.reactive.function.server.RouterFunctions; +import org.springframework.web.reactive.function.server.ServerResponse; /** * 路由配置信息 diff --git a/pig-register/src/main/java/com/alibaba/nacos/controller/NamespaceController.java b/pig-register/src/main/java/com/alibaba/nacos/controller/NamespaceController.java index 0a2874f4..2e60e9a1 100644 --- a/pig-register/src/main/java/com/alibaba/nacos/controller/NamespaceController.java +++ b/pig-register/src/main/java/com/alibaba/nacos/controller/NamespaceController.java @@ -28,13 +28,7 @@ import com.alibaba.nacos.model.Namespace; import com.alibaba.nacos.model.NamespaceAllInfo; import com.alibaba.nacos.security.nacos.NacosAuthConfig; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/pig-register/src/main/java/com/alibaba/nacos/controller/PermissionController.java b/pig-register/src/main/java/com/alibaba/nacos/controller/PermissionController.java index e94c6014..71f7c7f6 100644 --- a/pig-register/src/main/java/com/alibaba/nacos/controller/PermissionController.java +++ b/pig-register/src/main/java/com/alibaba/nacos/controller/PermissionController.java @@ -23,12 +23,7 @@ import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.security.nacos.NacosAuthConfig; import com.alibaba.nacos.security.nacos.roles.NacosRoleServiceImpl; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * Permission operation controller. diff --git a/pig-register/src/main/java/com/alibaba/nacos/controller/RoleController.java b/pig-register/src/main/java/com/alibaba/nacos/controller/RoleController.java index a8079f69..dca5f23b 100644 --- a/pig-register/src/main/java/com/alibaba/nacos/controller/RoleController.java +++ b/pig-register/src/main/java/com/alibaba/nacos/controller/RoleController.java @@ -23,12 +23,7 @@ import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.security.nacos.NacosAuthConfig; import com.alibaba.nacos.security.nacos.roles.NacosRoleServiceImpl; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; diff --git a/pig-register/src/main/java/com/alibaba/nacos/controller/UserController.java b/pig-register/src/main/java/com/alibaba/nacos/controller/UserController.java index 24ae0ab0..7e194bab 100644 --- a/pig-register/src/main/java/com/alibaba/nacos/controller/UserController.java +++ b/pig-register/src/main/java/com/alibaba/nacos/controller/UserController.java @@ -44,13 +44,7 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/pig-register/src/main/java/com/alibaba/nacos/security/nacos/roles/NacosRoleServiceImpl.java b/pig-register/src/main/java/com/alibaba/nacos/security/nacos/roles/NacosRoleServiceImpl.java index 6b447aaf..029c9365 100644 --- a/pig-register/src/main/java/com/alibaba/nacos/security/nacos/roles/NacosRoleServiceImpl.java +++ b/pig-register/src/main/java/com/alibaba/nacos/security/nacos/roles/NacosRoleServiceImpl.java @@ -24,20 +24,16 @@ import com.alibaba.nacos.config.server.auth.PermissionPersistService; import com.alibaba.nacos.config.server.auth.RoleInfo; import com.alibaba.nacos.config.server.auth.RolePersistService; import com.alibaba.nacos.config.server.model.Page; +import com.alibaba.nacos.core.utils.Loggers; import com.alibaba.nacos.security.nacos.NacosAuthConfig; import com.alibaba.nacos.security.nacos.users.NacosUserDetailsServiceImpl; -import com.alibaba.nacos.core.utils.Loggers; import io.jsonwebtoken.lang.Collections; import org.apache.mina.util.ConcurrentHashSet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Pattern; diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/PigSentinelApplication.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/PigSentinelApplication.java index 046faec9..5f57041a 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/PigSentinelApplication.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/PigSentinelApplication.java @@ -16,7 +16,6 @@ package com.alibaba.csp.sentinel.dashboard; import com.alibaba.csp.sentinel.init.InitExecutor; - import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/AuthAction.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/AuthAction.java index 641c1749..0976bf10 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/AuthAction.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/AuthAction.java @@ -15,11 +15,7 @@ */ package com.alibaba.csp.sentinel.dashboard.auth; -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; +import java.lang.annotation.*; /** * @author lkxiaolou diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/FakeAuthServiceImpl.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/FakeAuthServiceImpl.java index a90ce1c0..979ee565 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/FakeAuthServiceImpl.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/FakeAuthServiceImpl.java @@ -15,10 +15,10 @@ */ package com.alibaba.csp.sentinel.dashboard.auth; -import javax.servlet.http.HttpServletRequest; - import org.springframework.stereotype.Component; +import javax.servlet.http.HttpServletRequest; + /** * A fake AuthService implementation, which will pass all user auth checking. * diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/client/SentinelApiClient.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/client/SentinelApiClient.java index 60bb6624..ac6885ae 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/client/SentinelApiClient.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/client/SentinelApiClient.java @@ -15,28 +15,23 @@ */ package com.alibaba.csp.sentinel.dashboard.client; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.stream.Collectors; - import com.alibaba.csp.sentinel.adapter.gateway.common.rule.GatewayFlowRule; import com.alibaba.csp.sentinel.command.CommandConstants; -import com.alibaba.csp.sentinel.config.SentinelConfig; import com.alibaba.csp.sentinel.command.vo.NodeVo; +import com.alibaba.csp.sentinel.config.SentinelConfig; +import com.alibaba.csp.sentinel.dashboard.datasource.entity.SentinelVersion; import com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.ApiDefinitionEntity; import com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.GatewayFlowRuleEntity; +import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.*; +import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.ClusterClientInfoVO; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ClusterClientConfig; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerFlowConfig; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerTransportConfig; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterServerStateVO; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterStateSimpleEntity; import com.alibaba.csp.sentinel.dashboard.util.AsyncUtils; +import com.alibaba.csp.sentinel.dashboard.util.VersionUtils; import com.alibaba.csp.sentinel.slots.block.Rule; import com.alibaba.csp.sentinel.slots.block.authority.AuthorityRule; import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRule; @@ -46,22 +41,6 @@ import com.alibaba.csp.sentinel.slots.system.SystemRule; import com.alibaba.csp.sentinel.util.AssertUtil; import com.alibaba.csp.sentinel.util.StringUtil; import com.alibaba.fastjson.JSON; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.SentinelVersion; -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.datasource.entity.rule.FlowRuleEntity; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.ParamFlowRuleEntity; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.RuleEntity; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.SystemRuleEntity; -import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.ClusterClientInfoVO; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterServerStateVO; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterStateSimpleEntity; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ClusterClientConfig; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerFlowConfig; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerTransportConfig; -import com.alibaba.csp.sentinel.dashboard.util.VersionUtils; - import org.apache.http.Consts; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; @@ -84,6 +63,15 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.lang.Nullable; import org.springframework.stereotype.Component; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.Charset; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.stream.Collectors; + /** * Communicate with Sentinel client. * diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/DashboardConfig.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/DashboardConfig.java index d8040976..1684e5f2 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/DashboardConfig.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/DashboardConfig.java @@ -15,13 +15,13 @@ */ package com.alibaba.csp.sentinel.dashboard.config; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.NumberUtils; import org.springframework.lang.NonNull; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + /** *

* Dashboard local config support. diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/WebConfig.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/WebConfig.java index e3329892..7f886ad4 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/WebConfig.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/WebConfig.java @@ -15,16 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.config; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - import com.alibaba.csp.sentinel.adapter.servlet.CommonFilter; import com.alibaba.csp.sentinel.adapter.servlet.callback.WebCallbackManager; import com.alibaba.csp.sentinel.dashboard.auth.AuthorizationInterceptor; import com.alibaba.csp.sentinel.dashboard.auth.LoginAuthenticationFilter; import com.alibaba.csp.sentinel.util.StringUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -38,6 +33,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import javax.annotation.PostConstruct; import javax.servlet.Filter; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; /** * @author leyou diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AppController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AppController.java index aa99b366..b372453b 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AppController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AppController.java @@ -15,24 +15,19 @@ */ package com.alibaba.csp.sentinel.dashboard.controller; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - -import javax.servlet.http.HttpServletRequest; - import com.alibaba.csp.sentinel.dashboard.discovery.AppInfo; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.domain.Result; import com.alibaba.csp.sentinel.dashboard.domain.vo.MachineInfoVo; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; /** * @author Carpenter Lee diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthorityRuleController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthorityRuleController.java index ddffaa70..1d14a88d 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthorityRuleController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthorityRuleController.java @@ -15,32 +15,22 @@ */ package com.alibaba.csp.sentinel.dashboard.controller; -import java.util.Date; -import java.util.List; - import com.alibaba.csp.sentinel.dashboard.auth.AuthAction; -import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; -import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.auth.AuthService.PrivilegeType; -import com.alibaba.csp.sentinel.slots.block.RuleConstant; -import com.alibaba.csp.sentinel.util.StringUtil; - +import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.AuthorityRuleEntity; +import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.domain.Result; import com.alibaba.csp.sentinel.dashboard.repository.rule.RuleRepository; - +import com.alibaba.csp.sentinel.slots.block.RuleConstant; +import com.alibaba.csp.sentinel.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.List; /** * @author Eric Zhao diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/DegradeController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/DegradeController.java index 6a23ea93..3c0cc843 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/DegradeController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/DegradeController.java @@ -15,32 +15,23 @@ */ package com.alibaba.csp.sentinel.dashboard.controller; -import java.util.Date; -import java.util.List; - import com.alibaba.csp.sentinel.dashboard.auth.AuthAction; -import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; -import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.auth.AuthService.PrivilegeType; +import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; +import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; +import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; +import com.alibaba.csp.sentinel.dashboard.domain.Result; import com.alibaba.csp.sentinel.dashboard.repository.rule.RuleRepository; 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; - -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; -import com.alibaba.csp.sentinel.dashboard.domain.Result; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.List; /** * Controller regarding APIs of degrade rules. Refactored since 1.8.0. diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/DemoController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/DemoController.java index ae61723e..0a620738 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/DemoController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/DemoController.java @@ -15,9 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.controller; -import java.util.Random; -import java.util.concurrent.TimeUnit; - +import com.alibaba.csp.sentinel.Entry; +import com.alibaba.csp.sentinel.EntryType; +import com.alibaba.csp.sentinel.SphU; +import com.alibaba.csp.sentinel.context.ContextUtil; +import com.alibaba.csp.sentinel.slots.block.BlockException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.MediaType; @@ -25,11 +27,8 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import com.alibaba.csp.sentinel.Entry; -import com.alibaba.csp.sentinel.EntryType; -import com.alibaba.csp.sentinel.SphU; -import com.alibaba.csp.sentinel.context.ContextUtil; -import com.alibaba.csp.sentinel.slots.block.BlockException; +import java.util.Random; +import java.util.concurrent.TimeUnit; @Controller @RequestMapping(value = "/demo", produces = MediaType.APPLICATION_JSON_VALUE) diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/FlowControllerV1.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/FlowControllerV1.java index 9f4594c9..47d8d1c0 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/FlowControllerV1.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/FlowControllerV1.java @@ -15,33 +15,24 @@ */ package com.alibaba.csp.sentinel.dashboard.controller; -import java.util.Date; -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -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.util.StringUtil; - import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.domain.Result; import com.alibaba.csp.sentinel.dashboard.repository.rule.InMemoryRuleRepositoryAdapter; - +import com.alibaba.csp.sentinel.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; /** * Flow rule controller. diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/MachineRegistryController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/MachineRegistryController.java index 83f5312c..887659bb 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/MachineRegistryController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/MachineRegistryController.java @@ -16,11 +16,10 @@ package com.alibaba.csp.sentinel.dashboard.controller; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; -import com.alibaba.csp.sentinel.util.StringUtil; - import com.alibaba.csp.sentinel.dashboard.discovery.MachineDiscovery; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.dashboard.domain.Result; +import com.alibaba.csp.sentinel.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/MetricController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/MetricController.java index 32e6e962..18e6ecdb 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/MetricController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/MetricController.java @@ -15,17 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.controller; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import java.util.concurrent.ConcurrentHashMap; - +import com.alibaba.csp.sentinel.dashboard.datasource.entity.MetricEntity; import com.alibaba.csp.sentinel.dashboard.domain.Result; +import com.alibaba.csp.sentinel.dashboard.domain.vo.MetricVo; import com.alibaba.csp.sentinel.dashboard.repository.metric.MetricsRepository; +import com.alibaba.csp.sentinel.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -34,10 +28,8 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import com.alibaba.csp.sentinel.util.StringUtil; - -import com.alibaba.csp.sentinel.dashboard.datasource.entity.MetricEntity; -import com.alibaba.csp.sentinel.dashboard.domain.vo.MetricVo; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; /** * @author leyou diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/ParamFlowRuleController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/ParamFlowRuleController.java index e960bd34..4134d424 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/ParamFlowRuleController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/ParamFlowRuleController.java @@ -15,40 +15,31 @@ */ package com.alibaba.csp.sentinel.dashboard.controller; +import com.alibaba.csp.sentinel.dashboard.auth.AuthAction; +import com.alibaba.csp.sentinel.dashboard.auth.AuthService; +import com.alibaba.csp.sentinel.dashboard.auth.AuthService.PrivilegeType; +import com.alibaba.csp.sentinel.dashboard.client.CommandNotFoundException; +import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; +import com.alibaba.csp.sentinel.dashboard.datasource.entity.SentinelVersion; +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.domain.Result; +import com.alibaba.csp.sentinel.dashboard.repository.rule.RuleRepository; +import com.alibaba.csp.sentinel.dashboard.util.VersionUtils; +import com.alibaba.csp.sentinel.slots.block.RuleConstant; +import com.alibaba.csp.sentinel.util.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + import java.util.Date; import java.util.List; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -import com.alibaba.csp.sentinel.dashboard.auth.AuthAction; -import com.alibaba.csp.sentinel.dashboard.client.CommandNotFoundException; -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; -import com.alibaba.csp.sentinel.dashboard.auth.AuthService.PrivilegeType; -import com.alibaba.csp.sentinel.slots.block.RuleConstant; -import com.alibaba.csp.sentinel.util.StringUtil; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.SentinelVersion; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.ParamFlowRuleEntity; -import com.alibaba.csp.sentinel.dashboard.domain.Result; -import com.alibaba.csp.sentinel.dashboard.repository.rule.RuleRepository; -import com.alibaba.csp.sentinel.dashboard.util.VersionUtils; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - /** * @author Eric Zhao * @since 0.2.1 diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/ResourceController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/ResourceController.java index da8988e3..ad9148c6 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/ResourceController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/ResourceController.java @@ -15,17 +15,12 @@ */ package com.alibaba.csp.sentinel.dashboard.controller; -import java.util.List; -import java.util.stream.Collectors; - -import com.alibaba.csp.sentinel.util.StringUtil; import com.alibaba.csp.sentinel.command.vo.NodeVo; - -import com.alibaba.csp.sentinel.dashboard.domain.ResourceTreeNode; import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; +import com.alibaba.csp.sentinel.dashboard.domain.ResourceTreeNode; import com.alibaba.csp.sentinel.dashboard.domain.Result; import com.alibaba.csp.sentinel.dashboard.domain.vo.ResourceVo; - +import com.alibaba.csp.sentinel.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -33,6 +28,9 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; +import java.util.stream.Collectors; + /** * @author Carpenter Lee */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/SystemController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/SystemController.java index ac23dea5..58323f02 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/SystemController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/SystemController.java @@ -15,19 +15,14 @@ */ package com.alibaba.csp.sentinel.dashboard.controller; -import java.util.Date; -import java.util.List; - import com.alibaba.csp.sentinel.dashboard.auth.AuthAction; import com.alibaba.csp.sentinel.dashboard.auth.AuthService.PrivilegeType; -import com.alibaba.csp.sentinel.dashboard.repository.rule.RuleRepository; -import com.alibaba.csp.sentinel.util.StringUtil; - +import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.SystemRuleEntity; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; -import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.domain.Result; - +import com.alibaba.csp.sentinel.dashboard.repository.rule.RuleRepository; +import com.alibaba.csp.sentinel.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -35,6 +30,9 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.Date; +import java.util.List; + /** * @author leyou(lihao) */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/VersionController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/VersionController.java index 892a9eeb..ada7f51d 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/VersionController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/VersionController.java @@ -17,7 +17,6 @@ package com.alibaba.csp.sentinel.dashboard.controller; import com.alibaba.csp.sentinel.dashboard.domain.Result; import com.alibaba.csp.sentinel.util.StringUtil; - import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/cluster/ClusterAssignController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/cluster/ClusterAssignController.java index 6b43aa04..42c306f8 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/cluster/ClusterAssignController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/cluster/ClusterAssignController.java @@ -15,24 +15,19 @@ */ package com.alibaba.csp.sentinel.dashboard.controller.cluster; -import java.util.Collections; -import java.util.Set; - -import com.alibaba.csp.sentinel.util.StringUtil; - -import com.alibaba.csp.sentinel.dashboard.domain.cluster.ClusterAppFullAssignRequest; +import com.alibaba.csp.sentinel.dashboard.domain.Result; import com.alibaba.csp.sentinel.dashboard.domain.cluster.ClusterAppAssignResultVO; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.ClusterAppFullAssignRequest; import com.alibaba.csp.sentinel.dashboard.domain.cluster.ClusterAppSingleServerAssignRequest; import com.alibaba.csp.sentinel.dashboard.service.ClusterAssignService; -import com.alibaba.csp.sentinel.dashboard.domain.Result; +import com.alibaba.csp.sentinel.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.Collections; +import java.util.Set; /** * @author Eric Zhao diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/cluster/ClusterConfigController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/cluster/ClusterConfigController.java index 96b94963..f55dae83 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/cluster/ClusterConfigController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/cluster/ClusterConfigController.java @@ -15,18 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.controller.cluster; -import java.util.List; -import java.util.Optional; -import java.util.concurrent.ExecutionException; - import com.alibaba.csp.sentinel.cluster.ClusterStateManager; import com.alibaba.csp.sentinel.dashboard.client.CommandNotFoundException; -import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; -import com.alibaba.csp.sentinel.util.StringUtil; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; - import com.alibaba.csp.sentinel.dashboard.datasource.entity.SentinelVersion; +import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; +import com.alibaba.csp.sentinel.dashboard.domain.Result; import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterClientModifyRequest; import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterModifyRequest; import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterServerModifyRequest; @@ -37,17 +30,17 @@ import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterUniversalS import com.alibaba.csp.sentinel.dashboard.service.ClusterConfigService; import com.alibaba.csp.sentinel.dashboard.util.ClusterEntityUtils; import com.alibaba.csp.sentinel.dashboard.util.VersionUtils; -import com.alibaba.csp.sentinel.dashboard.domain.Result; +import com.alibaba.csp.sentinel.util.StringUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Optional; +import java.util.concurrent.ExecutionException; /** * @author Eric Zhao diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayFlowRuleController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayFlowRuleController.java index 0638982c..016d4f39 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayFlowRuleController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayFlowRuleController.java @@ -36,9 +36,9 @@ import java.util.Arrays; import java.util.Date; import java.util.List; -import static com.alibaba.csp.sentinel.slots.block.RuleConstant.*; import static com.alibaba.csp.sentinel.adapter.gateway.common.SentinelGatewayConstants.*; import static com.alibaba.csp.sentinel.dashboard.datasource.entity.gateway.GatewayFlowRuleEntity.*; +import static com.alibaba.csp.sentinel.slots.block.RuleConstant.*; /** * Gateway flow rule Controller for manage gateway flow rules. diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/v2/FlowControllerV2.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/v2/FlowControllerV2.java index e243132c..c655071d 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/v2/FlowControllerV2.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/v2/FlowControllerV2.java @@ -15,33 +15,23 @@ */ package com.alibaba.csp.sentinel.dashboard.controller.v2; -import java.util.Date; -import java.util.List; - import com.alibaba.csp.sentinel.dashboard.auth.AuthAction; import com.alibaba.csp.sentinel.dashboard.auth.AuthService; import com.alibaba.csp.sentinel.dashboard.auth.AuthService.PrivilegeType; -import com.alibaba.csp.sentinel.util.StringUtil; - import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity; +import com.alibaba.csp.sentinel.dashboard.domain.Result; import com.alibaba.csp.sentinel.dashboard.repository.rule.InMemoryRuleRepositoryAdapter; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRuleProvider; import com.alibaba.csp.sentinel.dashboard.rule.DynamicRulePublisher; -import com.alibaba.csp.sentinel.dashboard.domain.Result; - +import com.alibaba.csp.sentinel.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.Date; +import java.util.List; /** * Flow rule controller (v2). diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/ApplicationEntity.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/ApplicationEntity.java index cebe93ce..953c7849 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/ApplicationEntity.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/ApplicationEntity.java @@ -15,10 +15,10 @@ */ package com.alibaba.csp.sentinel.dashboard.datasource.entity; -import java.util.Date; - import com.alibaba.csp.sentinel.dashboard.discovery.AppInfo; +import java.util.Date; + /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/MachineEntity.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/MachineEntity.java index 037be22d..79d8a7ff 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/MachineEntity.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/MachineEntity.java @@ -15,10 +15,10 @@ */ package com.alibaba.csp.sentinel.dashboard.datasource.entity; -import java.util.Date; - import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; +import java.util.Date; + /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/AbstractRuleEntity.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/AbstractRuleEntity.java index 9e5213b3..43fb72f7 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/AbstractRuleEntity.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/AbstractRuleEntity.java @@ -15,10 +15,9 @@ */ package com.alibaba.csp.sentinel.dashboard.datasource.entity.rule; -import java.util.Date; - import com.alibaba.csp.sentinel.slots.block.AbstractRule; -import com.alibaba.csp.sentinel.slots.block.Rule; + +import java.util.Date; /** * @author Eric Zhao diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/DegradeRuleEntity.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/DegradeRuleEntity.java index 1be3746d..4804f0e2 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/DegradeRuleEntity.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/DegradeRuleEntity.java @@ -15,10 +15,10 @@ */ package com.alibaba.csp.sentinel.dashboard.datasource.entity.rule; -import java.util.Date; - import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRule; +import java.util.Date; + /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/FlowRuleEntity.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/FlowRuleEntity.java index e7b4e738..c83cb8ce 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/FlowRuleEntity.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/FlowRuleEntity.java @@ -15,11 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.datasource.entity.rule; -import java.util.Date; - import com.alibaba.csp.sentinel.slots.block.flow.ClusterFlowConfig; import com.alibaba.csp.sentinel.slots.block.flow.FlowRule; +import java.util.Date; + /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/RuleEntity.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/RuleEntity.java index 40ac6a0e..52d7e0f6 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/RuleEntity.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/datasource/entity/rule/RuleEntity.java @@ -15,10 +15,10 @@ */ package com.alibaba.csp.sentinel.dashboard.datasource.entity.rule; -import java.util.Date; - import com.alibaba.csp.sentinel.slots.block.Rule; +import java.util.Date; + /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/AppInfo.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/AppInfo.java index 3c69fd8b..463412c8 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/AppInfo.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/AppInfo.java @@ -15,15 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.discovery; -import java.util.Comparator; -import java.util.HashSet; -import java.util.Optional; -import java.util.Iterator; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - import com.alibaba.csp.sentinel.dashboard.config.DashboardConfig; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; + public class AppInfo { private String app = ""; diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/AppManagement.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/AppManagement.java index 79f4ad24..7733a516 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/AppManagement.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/AppManagement.java @@ -15,15 +15,14 @@ */ package com.alibaba.csp.sentinel.dashboard.discovery; -import java.util.List; -import java.util.Set; - -import javax.annotation.PostConstruct; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Component; +import javax.annotation.PostConstruct; +import java.util.List; +import java.util.Set; + @Component public class AppManagement implements MachineDiscovery { diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/MachineInfo.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/MachineInfo.java index 8d390180..2b4a080b 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/MachineInfo.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/MachineInfo.java @@ -15,11 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.discovery; -import java.util.Objects; - import com.alibaba.csp.sentinel.dashboard.config.DashboardConfig; import com.alibaba.csp.sentinel.util.StringUtil; +import java.util.Objects; + public class MachineInfo implements Comparable { private String app = ""; diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/SimpleMachineDiscovery.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/SimpleMachineDiscovery.java index f437358c..5d06c5f9 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/SimpleMachineDiscovery.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/SimpleMachineDiscovery.java @@ -15,6 +15,9 @@ */ package com.alibaba.csp.sentinel.dashboard.discovery; +import com.alibaba.csp.sentinel.util.AssertUtil; +import org.springframework.stereotype.Component; + import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -22,10 +25,6 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import com.alibaba.csp.sentinel.util.AssertUtil; - -import org.springframework.stereotype.Component; - /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/ResourceTreeNode.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/ResourceTreeNode.java index eb289c81..bb6dead7 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/ResourceTreeNode.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/ResourceTreeNode.java @@ -15,13 +15,13 @@ */ package com.alibaba.csp.sentinel.dashboard.domain; +import com.alibaba.csp.sentinel.command.vo.NodeVo; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import com.alibaba.csp.sentinel.command.vo.NodeVo; - /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/ClusterAppFullAssignRequest.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/ClusterAppFullAssignRequest.java index 629f0566..2e096080 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/ClusterAppFullAssignRequest.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/ClusterAppFullAssignRequest.java @@ -15,11 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.domain.cluster; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterAppAssignMap; + import java.util.List; import java.util.Set; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterAppAssignMap; - /** * @author Eric Zhao * @since 1.4.1 diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/ClusterAppSingleServerAssignRequest.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/ClusterAppSingleServerAssignRequest.java index 63aa1c35..3b5b2ac9 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/ClusterAppSingleServerAssignRequest.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/ClusterAppSingleServerAssignRequest.java @@ -15,10 +15,10 @@ */ package com.alibaba.csp.sentinel.dashboard.domain.cluster; -import java.util.Set; - import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterAppAssignMap; +import java.util.Set; + /** * @author Eric Zhao * @since 1.4.1 diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/request/ClusterServerModifyRequest.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/request/ClusterServerModifyRequest.java index 216ab8fa..02c96c27 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/request/ClusterServerModifyRequest.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/request/ClusterServerModifyRequest.java @@ -15,11 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.domain.cluster.request; -import java.util.Set; - import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerFlowConfig; import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerTransportConfig; +import java.util.Set; + /** * @author Eric Zhao * @since 1.4.0 diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/state/ClusterServerStateVO.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/state/ClusterServerStateVO.java index 1eabe4e3..dbd61607 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/state/ClusterServerStateVO.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/cluster/state/ClusterServerStateVO.java @@ -15,13 +15,13 @@ */ package com.alibaba.csp.sentinel.dashboard.domain.cluster.state; -import java.util.List; -import java.util.Set; - import com.alibaba.csp.sentinel.dashboard.domain.cluster.ConnectionGroupVO; import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerFlowConfig; import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerTransportConfig; +import java.util.List; +import java.util.Set; + /** * @author Eric Zhao * @since 1.4.0 diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/MachineInfoVo.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/MachineInfoVo.java index 8378198a..65a7fd95 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/MachineInfoVo.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/MachineInfoVo.java @@ -15,11 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.domain.vo; +import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; + import java.util.ArrayList; import java.util.List; -import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; - /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/MetricVo.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/MetricVo.java index 68211955..cdd5040e 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/MetricVo.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/MetricVo.java @@ -15,12 +15,12 @@ */ package com.alibaba.csp.sentinel.dashboard.domain.vo; +import com.alibaba.csp.sentinel.dashboard.datasource.entity.MetricEntity; + import java.util.ArrayList; import java.util.Collection; import java.util.List; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.MetricEntity; - /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/ResourceVo.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/ResourceVo.java index 512c3486..4fd4c2c0 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/ResourceVo.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/domain/vo/ResourceVo.java @@ -15,13 +15,12 @@ */ package com.alibaba.csp.sentinel.dashboard.domain.vo; +import com.alibaba.csp.sentinel.command.vo.NodeVo; +import com.alibaba.csp.sentinel.dashboard.domain.ResourceTreeNode; + import java.util.ArrayList; import java.util.List; -import com.alibaba.csp.sentinel.command.vo.NodeVo; - -import com.alibaba.csp.sentinel.dashboard.domain.ResourceTreeNode; - /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/metric/MetricFetcher.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/metric/MetricFetcher.java index 345c720e..8adb2309 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/metric/MetricFetcher.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/metric/MetricFetcher.java @@ -15,26 +15,6 @@ */ package com.alibaba.csp.sentinel.dashboard.metric; -import java.net.ConnectException; -import java.net.SocketTimeoutException; -import java.nio.charset.Charset; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.RejectedExecutionHandler; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.ThreadPoolExecutor.DiscardPolicy; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; - import com.alibaba.csp.sentinel.Constants; import com.alibaba.csp.sentinel.concurrent.NamedThreadFactory; import com.alibaba.csp.sentinel.config.SentinelConfig; @@ -42,10 +22,9 @@ import com.alibaba.csp.sentinel.dashboard.datasource.entity.MetricEntity; import com.alibaba.csp.sentinel.dashboard.discovery.AppInfo; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; +import com.alibaba.csp.sentinel.dashboard.repository.metric.MetricsRepository; import com.alibaba.csp.sentinel.node.metric.MetricNode; import com.alibaba.csp.sentinel.util.StringUtil; - -import com.alibaba.csp.sentinel.dashboard.repository.metric.MetricsRepository; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.concurrent.FutureCallback; @@ -61,6 +40,14 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.net.ConnectException; +import java.net.SocketTimeoutException; +import java.nio.charset.Charset; +import java.util.*; +import java.util.concurrent.*; +import java.util.concurrent.ThreadPoolExecutor.DiscardPolicy; +import java.util.concurrent.atomic.AtomicLong; + /** * Fetch metric of machines. * diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/metric/InMemoryMetricsRepository.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/metric/InMemoryMetricsRepository.java index c6eb22fd..684ffc2c 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/metric/InMemoryMetricsRepository.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/metric/InMemoryMetricsRepository.java @@ -20,11 +20,7 @@ import com.alibaba.csp.sentinel.util.StringUtil; import com.alibaba.csp.sentinel.util.TimeUtil; import org.springframework.stereotype.Component; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.locks.ReentrantReadWriteLock; diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemAuthorityRuleStore.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemAuthorityRuleStore.java index 176577e4..422e0e61 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemAuthorityRuleStore.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemAuthorityRuleStore.java @@ -15,12 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.repository.rule; -import java.util.concurrent.atomic.AtomicLong; - import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.AuthorityRuleEntity; - import org.springframework.stereotype.Component; +import java.util.concurrent.atomic.AtomicLong; + /** * In-memory storage for authority rules. * diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemDegradeRuleStore.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemDegradeRuleStore.java index 84ef0896..7891924d 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemDegradeRuleStore.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemDegradeRuleStore.java @@ -15,12 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.repository.rule; -import java.util.concurrent.atomic.AtomicLong; - import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity; - import org.springframework.stereotype.Component; +import java.util.concurrent.atomic.AtomicLong; + /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemFlowRuleStore.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemFlowRuleStore.java index 2010b65f..c54fdb2d 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemFlowRuleStore.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemFlowRuleStore.java @@ -15,13 +15,12 @@ */ package com.alibaba.csp.sentinel.dashboard.repository.rule; -import java.util.concurrent.atomic.AtomicLong; - import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity; import com.alibaba.csp.sentinel.slots.block.flow.ClusterFlowConfig; - import org.springframework.stereotype.Component; +import java.util.concurrent.atomic.AtomicLong; + /** * Store {@link FlowRuleEntity} in memory. * diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemParamFlowRuleStore.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemParamFlowRuleStore.java index bf764d19..6ca20401 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemParamFlowRuleStore.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemParamFlowRuleStore.java @@ -15,13 +15,12 @@ */ package com.alibaba.csp.sentinel.dashboard.repository.rule; -import java.util.concurrent.atomic.AtomicLong; - import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.ParamFlowRuleEntity; import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowClusterConfig; - import org.springframework.stereotype.Component; +import java.util.concurrent.atomic.AtomicLong; + /** * @author Eric Zhao * @since 0.2.1 diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemSystemRuleStore.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemSystemRuleStore.java index a97b6e9a..7a4e9433 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemSystemRuleStore.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemSystemRuleStore.java @@ -15,12 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.repository.rule; -import java.util.concurrent.atomic.AtomicLong; - import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.SystemRuleEntity; - import org.springframework.stereotype.Component; +import java.util.concurrent.atomic.AtomicLong; + /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemoryRuleRepositoryAdapter.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemoryRuleRepositoryAdapter.java index b97b297e..2e6e15cf 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemoryRuleRepositoryAdapter.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/InMemoryRuleRepositoryAdapter.java @@ -15,15 +15,15 @@ */ package com.alibaba.csp.sentinel.dashboard.repository.rule; +import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.RuleEntity; +import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; +import com.alibaba.csp.sentinel.util.AssertUtil; + import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.RuleEntity; -import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; -import com.alibaba.csp.sentinel.util.AssertUtil; - /** * @author leyou */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/RuleRepository.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/RuleRepository.java index aa3bc2a2..26f19d42 100755 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/RuleRepository.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/repository/rule/RuleRepository.java @@ -15,10 +15,10 @@ */ package com.alibaba.csp.sentinel.dashboard.repository.rule; -import java.util.List; - import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; +import java.util.List; + /** * Interface to store and find rules. * diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/FlowRuleApiProvider.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/FlowRuleApiProvider.java index 95e1e810..c5bf9fc8 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/FlowRuleApiProvider.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/FlowRuleApiProvider.java @@ -15,20 +15,18 @@ */ package com.alibaba.csp.sentinel.dashboard.rule; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; +import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.util.StringUtil; - -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity; - 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; + /** * @author Eric Zhao */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/FlowRuleApiPublisher.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/FlowRuleApiPublisher.java index 74987ec1..a5d8ac83 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/FlowRuleApiPublisher.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/rule/FlowRuleApiPublisher.java @@ -15,18 +15,17 @@ */ package com.alibaba.csp.sentinel.dashboard.rule; -import java.util.List; -import java.util.Set; - import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; +import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity; import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo; import com.alibaba.csp.sentinel.util.StringUtil; - -import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.FlowRuleEntity; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.List; +import java.util.Set; + /** * @author Eric Zhao * @since 1.4.0 diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterAssignService.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterAssignService.java index bd9c88aa..26be98d7 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterAssignService.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterAssignService.java @@ -15,12 +15,12 @@ */ package com.alibaba.csp.sentinel.dashboard.service; -import java.util.List; -import java.util.Set; - import com.alibaba.csp.sentinel.dashboard.domain.cluster.ClusterAppAssignResultVO; import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterAppAssignMap; +import java.util.List; +import java.util.Set; + /** * @author Eric Zhao * @since 1.4.1 diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterAssignServiceImpl.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterAssignServiceImpl.java index c9e34fc1..1635e8d6 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterAssignServiceImpl.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterAssignServiceImpl.java @@ -15,21 +15,7 @@ */ package com.alibaba.csp.sentinel.dashboard.service; -import java.util.HashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - import com.alibaba.csp.sentinel.cluster.ClusterStateManager; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterUniversalStatePairVO; -import com.alibaba.csp.sentinel.util.AssertUtil; -import com.alibaba.csp.sentinel.util.function.Tuple2; - import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; import com.alibaba.csp.sentinel.dashboard.domain.cluster.ClusterAppAssignResultVO; import com.alibaba.csp.sentinel.dashboard.domain.cluster.ClusterGroupEntity; @@ -37,12 +23,21 @@ import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ClusterClientCon import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerFlowConfig; import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerTransportConfig; import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterAppAssignMap; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterUniversalStatePairVO; import com.alibaba.csp.sentinel.dashboard.util.MachineUtils; +import com.alibaba.csp.sentinel.util.AssertUtil; +import com.alibaba.csp.sentinel.util.function.Tuple2; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + /** * @author Eric Zhao * @since 1.4.1 diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterConfigService.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterConfigService.java index 5ba46ddb..d1cf10ff 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterConfigService.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/service/ClusterConfigService.java @@ -15,32 +15,31 @@ */ package com.alibaba.csp.sentinel.dashboard.service; +import com.alibaba.csp.sentinel.cluster.ClusterStateManager; +import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; +import com.alibaba.csp.sentinel.dashboard.discovery.AppInfo; +import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.ClusterGroupEntity; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ClusterClientConfig; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerFlowConfig; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerTransportConfig; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterClientModifyRequest; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterServerModifyRequest; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterClientStateVO; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterUniversalStatePairVO; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterUniversalStateVO; +import com.alibaba.csp.sentinel.dashboard.util.AsyncUtils; +import com.alibaba.csp.sentinel.dashboard.util.ClusterEntityUtils; +import com.alibaba.csp.sentinel.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; -import com.alibaba.csp.sentinel.cluster.ClusterStateManager; -import com.alibaba.csp.sentinel.dashboard.client.SentinelApiClient; -import com.alibaba.csp.sentinel.dashboard.discovery.AppInfo; -import com.alibaba.csp.sentinel.dashboard.discovery.AppManagement; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterServerModifyRequest; -import com.alibaba.csp.sentinel.dashboard.util.AsyncUtils; -import com.alibaba.csp.sentinel.dashboard.util.ClusterEntityUtils; -import com.alibaba.csp.sentinel.util.StringUtil; - -import com.alibaba.csp.sentinel.dashboard.domain.cluster.ClusterGroupEntity; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.request.ClusterClientModifyRequest; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterClientStateVO; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterUniversalStatePairVO; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterUniversalStateVO; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ClusterClientConfig; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerFlowConfig; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.config.ServerTransportConfig; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - /** * @author Eric Zhao * @since 1.4.0 diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/AsyncUtils.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/AsyncUtils.java index fdd98b2e..b7372b27 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/AsyncUtils.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/AsyncUtils.java @@ -15,15 +15,15 @@ */ package com.alibaba.csp.sentinel.dashboard.util; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.util.List; import java.util.Objects; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * @author Eric Zhao * @since 1.4.1 diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/ClusterEntityUtils.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/ClusterEntityUtils.java index a50ffbec..c43e92d6 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/ClusterEntityUtils.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/ClusterEntityUtils.java @@ -15,23 +15,13 @@ */ package com.alibaba.csp.sentinel.dashboard.util; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - import com.alibaba.csp.sentinel.cluster.ClusterStateManager; -import com.alibaba.csp.sentinel.util.StringUtil; - import com.alibaba.csp.sentinel.dashboard.domain.cluster.ClusterGroupEntity; import com.alibaba.csp.sentinel.dashboard.domain.cluster.ConnectionGroupVO; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.AppClusterClientStateWrapVO; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.AppClusterServerStateWrapVO; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterClientStateVO; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterServerStateVO; -import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.ClusterUniversalStatePairVO; +import com.alibaba.csp.sentinel.dashboard.domain.cluster.state.*; +import com.alibaba.csp.sentinel.util.StringUtil; + +import java.util.*; /** * @author Eric Zhao diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/MachineUtils.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/MachineUtils.java index c21b781d..c124aee0 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/MachineUtils.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/MachineUtils.java @@ -15,11 +15,11 @@ */ package com.alibaba.csp.sentinel.dashboard.util; -import java.util.Optional; - import com.alibaba.csp.sentinel.util.StringUtil; import com.alibaba.csp.sentinel.util.function.Tuple2; +import java.util.Optional; + /** * @author Eric Zhao */ diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/VersionUtils.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/VersionUtils.java index d6d48c6b..cbc6f9e9 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/VersionUtils.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/util/VersionUtils.java @@ -15,11 +15,10 @@ */ package com.alibaba.csp.sentinel.dashboard.util; -import java.util.Optional; - +import com.alibaba.csp.sentinel.dashboard.datasource.entity.SentinelVersion; import com.alibaba.csp.sentinel.util.StringUtil; -import com.alibaba.csp.sentinel.dashboard.datasource.entity.SentinelVersion; +import java.util.Optional; /** * Util class for parsing version. diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java index 2c7108d2..02b88e43 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java @@ -1,6 +1,5 @@ package com.xxl.job.admin.controller; -import com.xxl.job.admin.core.cron.CronExpression; import com.xxl.job.admin.core.exception.XxlJobException; import com.xxl.job.admin.core.model.XxlJobGroup; import com.xxl.job.admin.core.model.XxlJobInfo; @@ -29,7 +28,6 @@ import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.text.ParseException; import java.util.*; /** diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java index c1edd06c..d7225dd1 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java @@ -1,7 +1,7 @@ package com.xxl.job.admin.controller; -import com.xxl.job.admin.core.exception.XxlJobException; import com.xxl.job.admin.core.complete.XxlJobCompleter; +import com.xxl.job.admin.core.exception.XxlJobException; import com.xxl.job.admin.core.model.XxlJobGroup; import com.xxl.job.admin.core.model.XxlJobInfo; import com.xxl.job.admin.core.model.XxlJobLog; diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java index cbdb3481..b59871f4 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java @@ -1,17 +1,16 @@ package com.xxl.job.admin.controller.interceptor; -import java.util.HashMap; - -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import com.xxl.job.admin.core.util.FtlUtil; import com.xxl.job.admin.core.util.I18nUtil; import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; + /** * push cookies to model as cookieMap * diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java index 74cca73e..2621d824 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java @@ -1,11 +1,5 @@ package com.xxl.job.admin.controller.interceptor; -import java.util.Arrays; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import com.xxl.job.admin.controller.annotation.PermissionLimit; import com.xxl.job.admin.core.model.XxlJobUser; import com.xxl.job.admin.core.util.I18nUtil; @@ -14,6 +8,11 @@ import org.springframework.stereotype.Component; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerInterceptor; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + /** * 权限拦截 * diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/WebMvcConfig.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/WebMvcConfig.java index 085092f8..a9a3d701 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/WebMvcConfig.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/WebMvcConfig.java @@ -1,11 +1,11 @@ package com.xxl.job.admin.controller.interceptor; -import javax.annotation.Resource; - import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import javax.annotation.Resource; + /** * web mvc config * @@ -26,4 +26,4 @@ public class WebMvcConfig implements WebMvcConfigurer { registry.addInterceptor(cookieInterceptor).addPathPatterns("/**"); } -} \ No newline at end of file +} diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java index 844aea84..7bb8484e 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java @@ -1,8 +1,8 @@ package com.xxl.job.admin.controller.resolver; import com.xxl.job.admin.core.exception.XxlJobException; -import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.admin.core.util.JacksonUtil; +import com.xxl.job.core.biz.model.ReturnT; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -66,4 +66,4 @@ public class WebExceptionResolver implements HandlerExceptionResolver { } } -} \ No newline at end of file +} diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java index 2543d442..4c52796e 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java @@ -1,12 +1,5 @@ package com.xxl.job.admin.core.alarm.impl; -import java.text.MessageFormat; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import javax.mail.internet.MimeMessage; - import com.xxl.job.admin.core.alarm.JobAlarm; import com.xxl.job.admin.core.conf.XxlJobAdminConfig; import com.xxl.job.admin.core.model.XxlJobGroup; @@ -19,6 +12,12 @@ import org.slf4j.LoggerFactory; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.stereotype.Component; +import javax.mail.internet.MimeMessage; +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + /** * job alarm by email * diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java index ec17d78c..36aff95a 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java @@ -1,23 +1,18 @@ package com.xxl.job.admin.core.conf; -import java.util.Arrays; - -import javax.annotation.Resource; -import javax.sql.DataSource; - import com.xxl.job.admin.core.alarm.JobAlarmer; import com.xxl.job.admin.core.scheduler.XxlJobScheduler; -import com.xxl.job.admin.dao.XxlJobGroupDao; -import com.xxl.job.admin.dao.XxlJobInfoDao; -import com.xxl.job.admin.dao.XxlJobLogDao; -import com.xxl.job.admin.dao.XxlJobLogReportDao; -import com.xxl.job.admin.dao.XxlJobRegistryDao; +import com.xxl.job.admin.dao.*; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Value; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Component; +import javax.annotation.Resource; +import javax.sql.DataSource; +import java.util.Arrays; + /** * xxl-job config * diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java index 8173104e..f52677fa 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/cron/CronExpression.java @@ -19,16 +19,7 @@ package com.xxl.job.admin.core.cron; import java.io.Serializable; import java.text.ParseException; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Locale; -import java.util.Map; -import java.util.SortedSet; -import java.util.StringTokenizer; -import java.util.TimeZone; -import java.util.TreeSet; +import java.util.*; /** * Provides a parser and evaluator for unix-like cron expressions. Cron expressions diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java index 8a4b91b4..530d6dbf 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java @@ -1,7 +1,7 @@ package com.xxl.job.admin.core.route.strategy; -import com.xxl.job.admin.core.scheduler.XxlJobScheduler; import com.xxl.job.admin.core.route.ExecutorRouter; +import com.xxl.job.admin.core.scheduler.XxlJobScheduler; import com.xxl.job.admin.core.util.I18nUtil; import com.xxl.job.core.biz.ExecutorBiz; import com.xxl.job.core.biz.model.IdleBeatParam; diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java index e93cf688..0889e3d3 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java @@ -1,7 +1,7 @@ package com.xxl.job.admin.core.route.strategy; -import com.xxl.job.admin.core.scheduler.XxlJobScheduler; import com.xxl.job.admin.core.route.ExecutorRouter; +import com.xxl.job.admin.core.scheduler.XxlJobScheduler; import com.xxl.job.admin.core.util.I18nUtil; import com.xxl.job.core.biz.ExecutorBiz; import com.xxl.job.core.biz.model.ReturnT; diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java index c21c3c1f..8effbc92 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java @@ -3,6 +3,7 @@ package com.xxl.job.admin.dao; import com.xxl.job.admin.core.model.XxlJobUser; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; + import java.util.List; /**