Skip to content

Commit

Permalink
Resolving PMD warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
KiteSoar committed Nov 25, 2024
1 parent c8d964d commit a36575e
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private ConfigQueryChainRequest buildChainRequest(HttpServletRequest request, St
String tenant, String tag, String clientIp) {
ConfigQueryChainRequest chainRequest = new ConfigQueryChainRequest();

Map<String, String> appLabels = new HashMap<>();
Map<String, String> appLabels = new HashMap<>(4);
String autoTag = request.getHeader(VIPSERVER_TAG);
appLabels.put(BetaGrayRule.CLIENT_IP_LABEL, clientIp);
if (StringUtils.isNotBlank(tag)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@
*/
public enum ApiVersionEnum {

/**
* API version v1.
*/
V1("v1"),

/**
* API version v2.
*/
V2("v2");

private final String version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,34 @@ public class ConfigQueryChainResponse {
private ConfigQueryStatus status;

public enum ConfigQueryStatus {
/**
* GrayRule-Beta Type.
*/
BETA,

/**
* GrayRule-Tag Type.
*/
TAG,

/**
* Tag not found.
*/
TAG_NOT_FOUND,

/**
* Formal.
*/
FORMAL,

/**
* Configuration query conflict.
*/
CONFIG_QUERY_CONFLICT,

/**
* Configuration not found.
*/
CONFIG_NOT_FOUND,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public ConfigQueryChainRequest buildChainRequest(ConfigQueryRequest request, Req
ConfigQueryChainRequest chainRequest = new ConfigQueryChainRequest();

String tag = request.getTag();
Map<String, String> appLabels = new HashMap<>();
Map<String, String> appLabels = new HashMap<>(4);
appLabels.put(BetaGrayRule.CLIENT_IP_LABEL, meta.getClientIp());
if (StringUtils.isNotBlank(tag)) {
appLabels.put(TagGrayRule.VIP_SERVER_TAG_LABEL, tag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@
*/
public interface ConfigQueryHandlerChainBuilder {

/**
* Builds the configuration query handler chain.
* @return the configuration query handler chain
*/
ConfigQueryHandlerChain build();

/**
* Adds a configuration query handler to the chain.
* @param handler the handler to be added
* @return the current builder instance
*/
ConfigQueryHandlerChainBuilder addHandler(ConfigQueryHandler handler);

}

0 comments on commit a36575e

Please sign in to comment.