Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DUBBO-3137]: move more constants out of ConfigConstants #4092

Merged
merged 1 commit into from
May 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import java.util.List;
import java.util.Map;

import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_PROTOCOL;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_AVAILABLE_CHECK_KEY;
import static org.apache.dubbo.rpc.cluster.Constants.INVOCATION_NEED_MOCK;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
public interface ConfigConstants {
String CLUSTER_KEY = "cluster";

String CONFIG_CLUSTER_KEY = "config.cluster";
String CONFIG_NAMESPACE_KEY = "config.namespace";
String CONFIG_GROUP_KEY = "config.group";
String CONFIG_CHECK_KEY = "config.check";

String USERNAME_KEY = "username";

String PASSWORD_KEY = "password";
Expand All @@ -36,42 +31,15 @@ public interface ConfigConstants {

String PORT_KEY = "port";

String REGISTER_IP_KEY = "register.ip";

String DUBBO_IP_TO_BIND = "DUBBO_IP_TO_BIND";

String SCOPE_KEY = "scope";

String SCOPE_LOCAL = "local";

String SCOPE_REMOTE = "remote";

@Deprecated
String SHUTDOWN_WAIT_SECONDS_KEY = "dubbo.service.shutdown.wait.seconds";

String SHUTDOWN_WAIT_KEY = "dubbo.service.shutdown.wait";

/**
* The key name for export URL in register center
*/
String EXPORT_KEY = "export";

/**
* The key name for reference URL in register center
*/
String REFER_KEY = "refer";

/**
* To decide whether to make connection when the client is created
*/
String LAZY_CONNECT_KEY = "lazy";

String DUBBO_PROTOCOL = "dubbo";

String ZOOKEEPER_PROTOCOL = "zookeeper";

String TELNET = "telnet";

String QOS_ENABLE = "qos.enable";

String QOS_PORT = "qos.port";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,13 @@ public interface RegistryConstants {
* key for router type, for e.g., "script"/"file", corresponding to ScriptRouterFactory.NAME, FileRouterFactory.NAME
*/
String ROUTER_KEY = "router";

/**
* The key name for export URL in register center
*/
String EXPORT_KEY = "export";
/**
* The key name for reference URL in register center
*/
String REFER_KEY = "refer";
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
import static org.apache.dubbo.common.constants.ConfigConstants.DUBBO_PROTOCOL;
import static org.apache.dubbo.config.Constants.LAYER_KEY;
import static org.apache.dubbo.config.Constants.LISTENER_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.REGISTER_IP_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;
import static org.apache.dubbo.registry.Constants.REGISTER_IP_KEY;
import static org.apache.dubbo.config.Constants.REGISTRIES_SUFFIX;
import static org.apache.dubbo.common.constants.ConfigConstants.SHUTDOWN_WAIT_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.SHUTDOWN_WAIT_SECONDS_KEY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import static org.apache.dubbo.rpc.cluster.Constants.CLUSTER_STICKY_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.GROUP_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.VERSION_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.LAZY_CONNECT_KEY;
import static org.apache.dubbo.rpc.Constants.LAZY_CONNECT_KEY;
import static org.apache.dubbo.rpc.Constants.INVOKER_LISTENER_KEY;
import static org.apache.dubbo.rpc.Constants.REFERENCE_FILTER_KEY;
import static org.apache.dubbo.rpc.Constants.STUB_EVENT_KEY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_VALUE;
import static org.apache.dubbo.common.constants.CommonConstants.PATH_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.PROTOCOL_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_CHECK_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_CLUSTER_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_GROUP_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_NAMESPACE_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.ZOOKEEPER_PROTOCOL;
import static org.apache.dubbo.configcenter.Constants.CONFIG_CHECK_KEY;
import static org.apache.dubbo.configcenter.Constants.CONFIG_CLUSTER_KEY;
import static org.apache.dubbo.configcenter.Constants.CONFIG_GROUP_KEY;
import static org.apache.dubbo.configcenter.Constants.CONFIG_NAMESPACE_KEY;
import static org.apache.dubbo.config.Constants.ZOOKEEPER_PROTOCOL;
import static org.apache.dubbo.config.Constants.CONFIG_CONFIGFILE_KEY;
import static org.apache.dubbo.config.Constants.CONFIG_ENABLE_KEY;
import static org.apache.dubbo.config.Constants.CONFIG_TIMEOUT_KEY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,5 @@ public interface Constants {

String REGISTRIES_SUFFIX = "dubbo.registries.";

String ZOOKEEPER_PROTOCOL = "zookeeper";
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import static org.apache.dubbo.common.constants.ConfigConstants.DUBBO_PROTOCOL;
import static org.apache.dubbo.common.constants.ConfigConstants.HOST_KEY;
import static org.apache.dubbo.config.Constants.PROTOCOLS_SUFFIX;
import static org.apache.dubbo.common.constants.ConfigConstants.TELNET;
import static org.apache.dubbo.remoting.Constants.TELNET;
import static org.apache.dubbo.common.constants.RpcConstants.DUBBO_VERSION_KEY;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import static org.apache.dubbo.common.constants.CommonConstants.THREADPOOL_KEY;
import static org.apache.dubbo.config.Constants.CONTEXTPATH_KEY;
import static org.apache.dubbo.config.Constants.STATUS_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.TELNET;
import static org.apache.dubbo.remoting.Constants.TELNET;

/**
* The service provider default configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
import static org.apache.dubbo.common.constants.CommonConstants.SIDE_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.CLUSTER_KEY;
import static org.apache.dubbo.config.Constants.DUBBO_IP_TO_REGISTRY;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.REGISTER_IP_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;
import static org.apache.dubbo.registry.Constants.REGISTER_IP_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.CONSUMER_PROTOCOL;
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_PROTOCOL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import static org.apache.dubbo.config.Constants.REGISTRIES_SUFFIX;
import static org.apache.dubbo.common.constants.ConfigConstants.SHUTDOWN_WAIT_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.USERNAME_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.ZOOKEEPER_PROTOCOL;
import static org.apache.dubbo.config.Constants.ZOOKEEPER_PROTOCOL;
import static org.apache.dubbo.common.constants.RegistryConstants.EXTRA_KEYS_KEY;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@
import static org.apache.dubbo.config.Constants.DUBBO_IP_TO_REGISTRY;
import static org.apache.dubbo.config.Constants.DUBBO_PORT_TO_BIND;
import static org.apache.dubbo.config.Constants.DUBBO_PORT_TO_REGISTRY;
import static org.apache.dubbo.common.constants.ConfigConstants.EXPORT_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.EXPORT_KEY;
import static org.apache.dubbo.config.Constants.MULTICAST;
import static org.apache.dubbo.config.Constants.PROTOCOLS_SUFFIX;
import static org.apache.dubbo.common.constants.ConfigConstants.SCOPE_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.SCOPE_LOCAL;
import static org.apache.dubbo.rpc.Constants.SCOPE_KEY;
import static org.apache.dubbo.rpc.Constants.SCOPE_LOCAL;
import static org.apache.dubbo.config.Constants.SCOPE_NONE;
import static org.apache.dubbo.common.constants.ConfigConstants.SCOPE_REMOTE;
import static org.apache.dubbo.rpc.Constants.SCOPE_REMOTE;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.DYNAMIC_KEY;
import static org.apache.dubbo.rpc.Constants.GENERIC_KEY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import static org.apache.dubbo.common.constants.CommonConstants.METHODS_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER;
import static org.apache.dubbo.common.constants.CommonConstants.SIDE_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.EXPORT_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.EXPORT_KEY;
import static org.apache.dubbo.config.Constants.SHUTDOWN_TIMEOUT_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.SHUTDOWN_WAIT_KEY;
import static org.apache.dubbo.remoting.Constants.BIND_IP_KEY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import java.util.Arrays;

import static org.apache.dubbo.common.constants.ConfigConstants.SCOPE_REMOTE;
import static org.apache.dubbo.rpc.Constants.SCOPE_REMOTE;


public class InvokerSideConfigUrlTest extends UrlTestBase {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.configcenter;

public interface Constants {
String CONFIG_CLUSTER_KEY = "config.cluster";
String CONFIG_NAMESPACE_KEY = "config.namespace";
String CONFIG_GROUP_KEY = "config.group";
String CONFIG_CHECK_KEY = "config.check";
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_VALUE;
import static org.apache.dubbo.common.constants.CommonConstants.APPLICATION_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.COMMA_SPLIT_PATTERN;
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_CHECK_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_CLUSTER_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_NAMESPACE_KEY;
import static org.apache.dubbo.configcenter.Constants.CONFIG_CHECK_KEY;
import static org.apache.dubbo.configcenter.Constants.CONFIG_CLUSTER_KEY;
import static org.apache.dubbo.configcenter.Constants.CONFIG_NAMESPACE_KEY;

/**
* Apollo implementation, https://github.com/ctripcorp/apollo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

import static java.util.concurrent.Executors.newCachedThreadPool;
import static org.apache.dubbo.common.constants.CommonConstants.PATH_SEPARATOR;
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_NAMESPACE_KEY;
import static org.apache.dubbo.configcenter.Constants.CONFIG_NAMESPACE_KEY;
import static org.apache.dubbo.configcenter.ConfigChangeType.ADDED;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.dubbo.common.constants.CommonConstants.PATH_SEPARATOR;
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_NAMESPACE_KEY;
import static org.apache.dubbo.configcenter.Constants.CONFIG_NAMESPACE_KEY;

/**
* The etcd implementation of {@link DynamicConfiguration}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import static com.alibaba.nacos.client.naming.utils.UtilAndComs.NACOS_NAMING_LOG_NAME;
import static org.apache.dubbo.common.constants.CommonConstants.GROUP_CHAR_SEPERATOR;
import static org.apache.dubbo.common.constants.CommonConstants.PROPERTIES_CHAR_SEPERATOR;
import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_NAMESPACE_KEY;
import static org.apache.dubbo.configcenter.Constants.CONFIG_NAMESPACE_KEY;
import static org.apache.dubbo.common.constants.RemotingConstants.BACKUP_KEY;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

import static org.apache.dubbo.common.constants.ConfigConstants.CONFIG_NAMESPACE_KEY;
import static org.apache.dubbo.configcenter.Constants.CONFIG_NAMESPACE_KEY;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;

import static org.apache.dubbo.common.constants.ConfigConstants.EXPORT_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.EXPORT_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;

/**
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dubbo.registry;

public interface Constants {
String REGISTER_IP_KEY = "register.ip";
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.PROTOCOL_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.DUBBO_PROTOCOL;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.APP_DYNAMIC_CONFIGURATORS_CATEGORY;
import static org.apache.dubbo.common.constants.RegistryConstants.CATEGORY_KEY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
import static org.apache.dubbo.common.constants.CommonConstants.VERSION_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.ACCEPT_FOREIGN_IP;
import static org.apache.dubbo.common.constants.ConfigConstants.CLUSTER_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.EXPORT_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.EXPORT_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.QOS_ENABLE;
import static org.apache.dubbo.common.constants.ConfigConstants.QOS_PORT;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.REGISTER_IP_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;
import static org.apache.dubbo.registry.Constants.REGISTER_IP_KEY;
import static org.apache.dubbo.common.constants.FilterConstants.VALIDATION_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.MONITOR_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.CATEGORY_KEY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import java.util.concurrent.locks.ReentrantLock;

import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.EXPORT_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.EXPORT_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;

/**
* AbstractRegistryFactory. (SPI, Singleton, ThreadSafe)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.METHODS_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.TIMEOUT_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.EXPORT_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.LAZY_CONNECT_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.EXPORT_KEY;
import static org.apache.dubbo.rpc.Constants.LAZY_CONNECT_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.CONSUMER_PROTOCOL;
import static org.apache.dubbo.common.constants.RemotingConstants.BACKUP_KEY;
import static org.apache.dubbo.remoting.Constants.CONNECT_TIMEOUT_KEY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import static org.apache.dubbo.common.constants.CommonConstants.DISABLED_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.ENABLED_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.SIDE_KEY;
import static org.apache.dubbo.common.constants.ConfigConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.REFER_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.CATEGORY_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.CONFIGURATORS_CATEGORY;
import static org.apache.dubbo.common.constants.RegistryConstants.EMPTY_PROTOCOL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import java.util.ArrayList;
import java.util.List;

import static org.apache.dubbo.common.constants.ConfigConstants.EXPORT_KEY;
import static org.apache.dubbo.common.constants.RegistryConstants.EXPORT_KEY;
import static org.apache.dubbo.registry.integration.RegistryProtocol.DEFAULT_REGISTER_PROVIDER_KEYS;
import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,5 @@ public interface Constants {
String PROMPT_KEY = "prompt";

String DEFAULT_PROMPT = "dubbo>";
String TELNET = "telnet";
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.apache.dubbo.remoting.transport.ChannelHandlerAdapter;

import static org.apache.dubbo.common.constants.CommonConstants.COMMA_SPLIT_PATTERN;
import static org.apache.dubbo.common.constants.ConfigConstants.TELNET;
import static org.apache.dubbo.remoting.Constants.TELNET;

public class TelnetHandlerAdapter extends ChannelHandlerAdapter implements TelnetHandler {

Expand Down
Loading