diff --git a/pom.xml b/pom.xml
index ac929206..723a0a22 100644
--- a/pom.xml
+++ b/pom.xml
@@ -107,7 +107,6 @@
spring-cloud-alibaba-examples
spring-cloud-alibaba-docs
spring-cloud-starter-alibaba
- spring-cloud-starter-alicloud
spring-cloud-alibaba-coverage
diff --git a/spring-cloud-starter-alicloud/pom.xml b/spring-cloud-starter-alicloud/pom.xml
deleted file mode 100644
index 06313076..00000000
--- a/spring-cloud-starter-alicloud/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
- 4.0.0
-
-
- com.alibaba.cloud
- spring-cloud-alibaba
- 2.2.1.BUILD-SNAPSHOT
- ../pom.xml
-
-
- spring-cloud-starter-alicloud
- pom
- Spring Cloud Alibaba Cloud Starters
- Spring Cloud Alibaba Cloud Starters
-
- spring-cloud-alicloud-context
- spring-cloud-starter-alicloud-oss
- spring-cloud-starter-alicloud-acm
- spring-cloud-starter-alicloud-ans
- spring-cloud-starter-alicloud-schedulerx
- spring-cloud-starter-alicloud-sms
-
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- ${jacoco.version}
-
-
- jacoco-initialize
-
- prepare-agent
-
-
-
- jacoco-site
- test
-
- report
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/pom.xml b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/pom.xml
deleted file mode 100644
index 2f7aee35..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/pom.xml
+++ /dev/null
@@ -1,147 +0,0 @@
-
-
-
-
- com.alibaba.cloud
- spring-cloud-starter-alicloud
- 2.2.1.BUILD-SNAPSHOT
- ../pom.xml
-
-
- 4.0.0
-
- spring-cloud-alicloud-context
- Spring Cloud AliCloud Context
-
-
-
-
- com.aliyun
- aliyun-java-sdk-edas
- provided
-
-
- com.aliyun
- aliyun-java-sdk-core
-
-
-
-
-
- com.alibaba.cloud
- alicloud-context
-
-
-
- com.aliyun
- aliyun-java-sdk-core
- provided
-
-
-
- com.alibaba.edas
- schedulerX-client
- provided
-
-
-
- com.alibaba.ans
- ans-sdk
- provided
-
-
-
- com.aliyun.oss
- aliyun-sdk-oss
- provided
-
-
-
- com.alibaba.edas.acm
- acm-sdk
- provided
-
-
-
- org.springframework.cloud
- spring-cloud-commons
- true
-
-
-
- org.springframework.boot
- spring-boot-starter-logging
- true
-
-
-
- org.springframework.boot
- spring-boot
- true
-
-
-
- org.springframework.boot
- spring-boot-autoconfigure
- true
-
-
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
- org.springframework.boot
- spring-boot-starter-web
- test
-
-
-
- org.powermock
- powermock-module-junit4
- 2.0.0
- test
-
-
-
- org.powermock
- powermock-api-mockito2
- 2.0.0
- test
-
-
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- ${jacoco.version}
-
-
- jacoco-initialize
-
- prepare-agent
-
-
-
- jacoco-site
- test
-
- report
-
-
-
-
-
-
-
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/AliCloudContextAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/AliCloudContextAutoConfiguration.java
deleted file mode 100644
index e364fc53..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/AliCloudContextAutoConfiguration.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context;
-
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.cloud.commons.util.InetUtils;
-import org.springframework.cloud.commons.util.InetUtilsProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author xiaolongzuo
- * @author theonefx
- */
-@Configuration(proxyBeanMethods = false)
-public class AliCloudContextAutoConfiguration {
-
- @Configuration(proxyBeanMethods = false)
- @EnableConfigurationProperties(AliCloudProperties.class)
- static class AliCloudPropertiesConfiguration {
-
- }
-
- @Configuration(proxyBeanMethods = false)
- @EnableConfigurationProperties(InetUtilsProperties.class)
- @ConditionalOnClass(InetUtilsProperties.class)
- static class InetUtilsConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- public InetUtils inetUtils(InetUtilsProperties inetUtilsProperties) {
- return new InetUtils(inetUtilsProperties);
- }
-
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/AliCloudProperties.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/AliCloudProperties.java
deleted file mode 100644
index 43af7e1e..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/AliCloudProperties.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context;
-
-import com.alibaba.cloud.context.AliCloudConfiguration;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * @author xiaolongzuo
- */
-@ConfigurationProperties("spring.cloud.alicloud")
-public class AliCloudProperties implements AliCloudConfiguration {
-
- /**
- * alibaba cloud access key.
- */
- private String accessKey;
-
- /**
- * alibaba cloud secret key.
- */
- private String secretKey;
-
- @Override
- public String getAccessKey() {
- return accessKey;
- }
-
- public void setAccessKey(String accessKey) {
- this.accessKey = accessKey;
- }
-
- @Override
- public String getSecretKey() {
- return secretKey;
- }
-
- public void setSecretKey(String secretKey) {
- this.secretKey = secretKey;
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/Constants.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/Constants.java
deleted file mode 100644
index 36aadc0f..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/Constants.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context;
-
-/**
- * @author Jim
- */
-public final class Constants {
-
- private Constants() {
- throw new AssertionError("Must not instantiate constant utility class");
- }
-
- public final class Sentinel {
-
- /**
- * prefix of sentinel.
- */
- public static final String PROPERTY_PREFIX = "spring.cloud.sentinel";
-
- /**
- * nacos access key.
- */
- public static final String NACOS_DATASOURCE_AK = PROPERTY_PREFIX
- + ".nacos.config.access-key";
-
- /**
- * nacos secret key.
- */
- public static final String NACOS_DATASOURCE_SK = PROPERTY_PREFIX
- + ".nacos.config.secret-key";
-
- /**
- * nacos namespace.
- */
- public static final String NACOS_DATASOURCE_NAMESPACE = PROPERTY_PREFIX
- + ".nacos.config.namespace";
-
- /**
- * nacos endpoint.
- */
- public static final String NACOS_DATASOURCE_ENDPOINT = PROPERTY_PREFIX
- + ".nacos.config.endpoint";
-
- /**
- * nacos project name.
- */
- public static final String PROJECT_NAME = PROPERTY_PREFIX
- + ".nacos.config.project-name";
-
- private Sentinel() {
- throw new AssertionError("Must not instantiate constant utility class");
- }
-
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/acm/AcmContextBootstrapConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/acm/AcmContextBootstrapConfiguration.java
deleted file mode 100644
index bbf74c7c..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/acm/AcmContextBootstrapConfiguration.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.acm;
-
-import javax.annotation.PostConstruct;
-
-import com.alibaba.alicloud.context.AliCloudProperties;
-import com.alibaba.alicloud.context.edas.EdasContextAutoConfiguration;
-import com.alibaba.alicloud.context.edas.EdasProperties;
-import com.alibaba.cloud.context.acm.AliCloudAcmInitializer;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.env.Environment;
-import org.springframework.util.Assert;
-import org.springframework.util.StringUtils;
-
-/**
- * @author xiaolongzuo
- */
-@Configuration(proxyBeanMethods = false)
-@EnableConfigurationProperties(AcmProperties.class)
-@ConditionalOnClass(name = "com.alibaba.alicloud.acm.AcmAutoConfiguration")
-@ImportAutoConfiguration(EdasContextAutoConfiguration.class)
-public class AcmContextBootstrapConfiguration {
-
- @Autowired
- private AcmProperties acmProperties;
-
- @Autowired
- private EdasProperties edasProperties;
-
- @Autowired
- private AliCloudProperties aliCloudProperties;
-
- @Autowired
- private Environment environment;
-
- @PostConstruct
- public void initAcmProperties() {
- AliCloudAcmInitializer.initialize(aliCloudProperties, edasProperties,
- acmProperties);
- }
-
- @Bean
- public AcmIntegrationProperties acmIntegrationProperties() {
- AcmIntegrationProperties acmIntegrationProperties = new AcmIntegrationProperties();
- String applicationName = environment.getProperty("spring.application.name");
- String applicationGroup = environment.getProperty("spring.application.group");
- Assert.isTrue(!StringUtils.isEmpty(applicationName),
- "'spring.application.name' must be configured in bootstrap.properties or bootstrap.yml/yaml...");
- acmIntegrationProperties.setApplicationName(applicationName);
- acmIntegrationProperties.setApplicationGroup(applicationGroup);
- acmIntegrationProperties.setActiveProfiles(environment.getActiveProfiles());
- acmIntegrationProperties.setAcmProperties(acmProperties);
- return acmIntegrationProperties;
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/acm/AcmIntegrationProperties.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/acm/AcmIntegrationProperties.java
deleted file mode 100644
index 88d35579..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/acm/AcmIntegrationProperties.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.acm;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.springframework.util.StringUtils;
-
-/**
- * @author xiaolongzuo
- */
-public class AcmIntegrationProperties {
-
- private String applicationName;
-
- private String applicationGroup;
-
- private String[] activeProfiles = new String[0];
-
- private AcmProperties acmProperties;
-
- public String getApplicationConfigurationDataIdWithoutGroup() {
- return applicationName + "." + acmProperties.getFileExtension();
- }
-
- public List getGroupConfigurationDataIds() {
- List groupConfigurationDataIds = new ArrayList<>();
- if (StringUtils.isEmpty(applicationGroup)) {
- return groupConfigurationDataIds;
- }
- String[] parts = applicationGroup.split("\\.");
- for (int i = 1; i < parts.length; i++) {
- StringBuilder subGroup = new StringBuilder(parts[0]);
- for (int j = 1; j <= i; j++) {
- subGroup.append(".").append(parts[j]);
- }
- groupConfigurationDataIds
- .add(subGroup + ":application." + acmProperties.getFileExtension());
- }
- return groupConfigurationDataIds;
- }
-
- public List getApplicationConfigurationDataIds() {
- List applicationConfigurationDataIds = new ArrayList<>();
- if (!StringUtils.isEmpty(applicationGroup)) {
- applicationConfigurationDataIds.add(applicationGroup + ":" + applicationName
- + "." + acmProperties.getFileExtension());
- for (String profile : activeProfiles) {
- applicationConfigurationDataIds
- .add(applicationGroup + ":" + applicationName + "-" + profile
- + "." + acmProperties.getFileExtension());
- }
-
- }
- applicationConfigurationDataIds
- .add(applicationName + "." + acmProperties.getFileExtension());
- for (String profile : activeProfiles) {
- applicationConfigurationDataIds.add(applicationName + "-" + profile + "."
- + acmProperties.getFileExtension());
- }
- return applicationConfigurationDataIds;
- }
-
- public void setApplicationName(String applicationName) {
- this.applicationName = applicationName;
- }
-
- public void setApplicationGroup(String applicationGroup) {
- this.applicationGroup = applicationGroup;
- }
-
- public void setActiveProfiles(String[] activeProfiles) {
- this.activeProfiles = activeProfiles;
- }
-
- public String[] getActiveProfiles() {
- return activeProfiles;
- }
-
- public void setAcmProperties(AcmProperties acmProperties) {
- this.acmProperties = acmProperties;
- }
-
- public AcmProperties getAcmProperties() {
- return acmProperties;
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/acm/AcmProperties.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/acm/AcmProperties.java
deleted file mode 100644
index dea83224..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/acm/AcmProperties.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.acm;
-
-import com.alibaba.cloud.context.AliCloudServerMode;
-import com.alibaba.cloud.context.acm.AcmConfiguration;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * acm properties.
- *
- * @author leijuan
- * @author xiaolongzuo
- */
-@ConfigurationProperties(prefix = "spring.cloud.alicloud.acm")
-public class AcmProperties implements AcmConfiguration {
-
- private AliCloudServerMode serverMode = AliCloudServerMode.LOCAL;
-
- private String serverList = "127.0.0.1";
-
- private String serverPort = "8080";
-
- /**
- * diamond group.
- */
- private String group = "DEFAULT_GROUP";
-
- /**
- * timeout to get configuration.
- */
- private int timeout = 3000;
-
- /**
- * the AliYun endpoint for ACM.
- */
- private String endpoint;
-
- /**
- * ACM namespace.
- */
- private String namespace;
-
- /**
- * name of ram role granted to ECS.
- */
- private String ramRoleName;
-
- private String fileExtension = "properties";
-
- private boolean refreshEnabled = true;
-
- public String getFileExtension() {
- return fileExtension;
- }
-
- public void setFileExtension(String fileExtension) {
- this.fileExtension = fileExtension;
- }
-
- @Override
- public String getServerList() {
- return serverList;
- }
-
- public void setServerList(String serverList) {
- this.serverList = serverList;
- }
-
- @Override
- public String getServerPort() {
- return serverPort;
- }
-
- public void setServerPort(String serverPort) {
- this.serverPort = serverPort;
- }
-
- @Override
- public boolean isRefreshEnabled() {
- return refreshEnabled;
- }
-
- public void setRefreshEnabled(boolean refreshEnabled) {
- this.refreshEnabled = refreshEnabled;
- }
-
- @Override
- public String getGroup() {
- return group;
- }
-
- public void setGroup(String group) {
- this.group = group;
- }
-
- @Override
- public int getTimeout() {
- return timeout;
- }
-
- public void setTimeout(int timeout) {
- this.timeout = timeout;
- }
-
- @Override
- public String getEndpoint() {
- return endpoint;
- }
-
- public void setEndpoint(String endpoint) {
- this.endpoint = endpoint;
- }
-
- @Override
- public String getNamespace() {
- return namespace;
- }
-
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- @Override
- public String getRamRoleName() {
- return ramRoleName;
- }
-
- public void setRamRoleName(String ramRoleName) {
- this.ramRoleName = ramRoleName;
- }
-
- @Override
- public AliCloudServerMode getServerMode() {
- return serverMode;
- }
-
- public void setServerMode(AliCloudServerMode serverMode) {
- this.serverMode = serverMode;
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/ans/AnsContextApplicationListener.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/ans/AnsContextApplicationListener.java
deleted file mode 100644
index 2100b5fb..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/ans/AnsContextApplicationListener.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.ans;
-
-import com.alibaba.alicloud.context.AliCloudProperties;
-import com.alibaba.alicloud.context.edas.EdasProperties;
-import com.alibaba.alicloud.context.listener.AbstractOnceApplicationListener;
-import com.alibaba.cloud.context.ans.AliCloudAnsInitializer;
-import com.alibaba.cloud.context.edas.AliCloudEdasSdk;
-
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.event.ContextRefreshedEvent;
-
-/**
- * Init {@link com.alibaba.ans.core.NamingService} properties.
- *
- * @author xiaolongzuo
- */
-public class AnsContextApplicationListener
- extends AbstractOnceApplicationListener {
-
- @Override
- protected String conditionalOnClass() {
- return "com.alibaba.alicloud.ans.AnsAutoConfiguration";
- }
-
- @Override
- public void handleEvent(ContextRefreshedEvent event) {
- ApplicationContext applicationContext = event.getApplicationContext();
- AliCloudProperties aliCloudProperties = applicationContext
- .getBean(AliCloudProperties.class);
- EdasProperties edasProperties = applicationContext.getBean(EdasProperties.class);
- AnsProperties ansProperties = applicationContext.getBean(AnsProperties.class);
- AliCloudEdasSdk aliCloudEdasSdk = applicationContext
- .getBean(AliCloudEdasSdk.class);
- AliCloudAnsInitializer.initialize(aliCloudProperties, edasProperties,
- ansProperties, aliCloudEdasSdk);
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/ans/AnsContextAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/ans/AnsContextAutoConfiguration.java
deleted file mode 100644
index 32c4a602..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/ans/AnsContextAutoConfiguration.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.ans;
-
-import com.alibaba.alicloud.context.edas.EdasContextAutoConfiguration;
-
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author xiaolongzuo
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnClass(name = "com.alibaba.alicloud.ans.AnsAutoConfiguration")
-@EnableConfigurationProperties(AnsProperties.class)
-@ImportAutoConfiguration(EdasContextAutoConfiguration.class)
-public class AnsContextAutoConfiguration {
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/ans/AnsProperties.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/ans/AnsProperties.java
deleted file mode 100644
index cf5592e0..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/ans/AnsProperties.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.ans;
-
-import java.net.Inet4Address;
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.net.SocketException;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-
-import com.alibaba.cloud.context.AliCloudServerMode;
-import com.alibaba.cloud.context.ans.AnsConfiguration;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.cloud.commons.util.InetUtils;
-import org.springframework.util.StringUtils;
-
-/**
- * @author xiaolongzuo
- */
-@ConfigurationProperties("spring.cloud.alicloud.ans")
-public class AnsProperties implements AnsConfiguration {
-
- /**
- * Server side mode,the default is LOCAL.
- */
- private AliCloudServerMode serverMode = AliCloudServerMode.LOCAL;
-
- /**
- * Server list.
- */
- private String serverList = "127.0.0.1";
-
- /**
- * Server port.
- */
- private String serverPort = "8080";
-
- /**
- * Service names,default value is ${spring.cloud.alicloud.ans.doms}. When not
- * configured, use ${spring.application.name}.
- */
- @Value("${spring.cloud.alicloud.ans.client-domains:${spring.application.name:}}")
- private String clientDomains;
-
- /**
- * The weight of the registration service, obtained from the configuration
- * ${spring.cloud.alicloud.ans.weight}, the default is 1.
- */
- private float clientWeight = 1;
-
- /**
- * When there are multiple doms and need to correspond to different weights, configure
- * them by spring.cloud.alicloud.ans.weight.dom1=weight1.
- */
- private Map clientWeights = new HashMap();
-
- /**
- * The token of the registration service, obtained from
- * ${spring.cloud.alicloud.ans.token}.
- */
- private String clientToken;
-
- /**
- * When there are multiple doms and need to correspond to different tokens, configure
- * them by spring.cloud.alicloud.ans.tokens.dom1=token1.
- */
- private Map clientTokens = new HashMap();
-
- /**
- * Configure which cluster to register with, obtained from
- * ${spring.cloud.alicloud.ans.cluster}, defaults to DEFAULT.
- */
- private String clientCluster = "DEFAULT";
-
- /**
- * Temporarily not supported, reserved fields.
- */
- private Map clientMetadata = new HashMap<>();
-
- /**
- * Registration is turned on by default, and registration can be turned off by the
- * configuration of spring.cloud.alicloud.ans.register-enabled=false.
- */
- private boolean registerEnabled = true;
-
- /**
- * The ip of the service you want to publish, obtained from
- * ${spring.cloud.alicloud.ans.client-ip}.
- */
- private String clientIp;
-
- /**
- * Configure which NIC the ip of the service you want to publish is obtained from.
- */
- private String clientInterfaceName;
-
- /**
- * The port of the service you want to publish.
- */
- private int clientPort = -1;
-
- /**
- * The environment isolation configuration under the tenant, the services in the same
- * environment of the same tenant can discover each other.
- */
- @Value("${spring.cloud.alicloud.ans.env:${env.id:DEFAULT}}")
- private String env;
-
- /**
- * Whether to register as https, configured by ${spring.cloud.alicloud.ans.secure},
- * default is false.
- */
- private boolean secure = false;
-
- @Autowired
- private InetUtils inetUtils;
-
- private Map tags = new HashMap<>();
-
- @PostConstruct
- public void init() throws SocketException {
-
- // Marked as spring cloud application
- tags.put("ANS_SERVICE_TYPE", "SPRING_CLOUD");
-
- if (StringUtils.isEmpty(clientIp)) {
- if (StringUtils.isEmpty(clientInterfaceName)) {
- clientIp = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
- }
- else {
- NetworkInterface networkInterface = NetworkInterface
- .getByName(clientInterfaceName);
- if (null == networkInterface) {
- throw new RuntimeException(
- "no such network interface " + clientInterfaceName);
- }
-
- Enumeration inetAddress = networkInterface
- .getInetAddresses();
- while (inetAddress.hasMoreElements()) {
- InetAddress currentAddress = inetAddress.nextElement();
- if (currentAddress instanceof Inet4Address
- && !currentAddress.isLoopbackAddress()) {
- clientIp = currentAddress.getHostAddress();
- break;
- }
- }
-
- if (StringUtils.isEmpty(clientIp)) {
- throw new RuntimeException(
- "cannot find available ip from network interface "
- + clientInterfaceName);
- }
-
- }
- }
- }
-
- @Override
- public String getServerPort() {
- return serverPort;
- }
-
- public void setServerPort(String serverPort) {
- this.serverPort = serverPort;
- }
-
- @Override
- public String getServerList() {
- return serverList;
- }
-
- public void setServerList(String serverList) {
- this.serverList = serverList;
- }
-
- @Override
- public boolean isRegisterEnabled() {
- return registerEnabled;
- }
-
- public void setRegisterEnabled(boolean registerEnabled) {
- this.registerEnabled = registerEnabled;
- }
-
- @Override
- public boolean isSecure() {
- return secure;
- }
-
- public void setSecure(boolean secure) {
- this.secure = secure;
- }
-
- @Override
- public String getEnv() {
- return env;
- }
-
- public void setEnv(String env) {
- this.env = env;
- }
-
- @Override
- public Map getTags() {
- return tags;
- }
-
- public void setTags(Map tags) {
- this.tags = tags;
- }
-
- @Override
- public AliCloudServerMode getServerMode() {
- return serverMode;
- }
-
- public void setServerMode(AliCloudServerMode serverMode) {
- this.serverMode = serverMode;
- }
-
- @Override
- public String getClientDomains() {
- return clientDomains;
- }
-
- public void setClientDomains(String clientDomains) {
- this.clientDomains = clientDomains;
- }
-
- @Override
- public float getClientWeight() {
- return clientWeight;
- }
-
- public void setClientWeight(float clientWeight) {
- this.clientWeight = clientWeight;
- }
-
- @Override
- public Map getClientWeights() {
- return clientWeights;
- }
-
- public void setClientWeights(Map clientWeights) {
- this.clientWeights = clientWeights;
- }
-
- @Override
- public String getClientToken() {
- return clientToken;
- }
-
- public void setClientToken(String clientToken) {
- this.clientToken = clientToken;
- }
-
- @Override
- public Map getClientTokens() {
- return clientTokens;
- }
-
- public void setClientTokens(Map clientTokens) {
- this.clientTokens = clientTokens;
- }
-
- @Override
- public String getClientCluster() {
- return clientCluster;
- }
-
- public void setClientCluster(String clientCluster) {
- this.clientCluster = clientCluster;
- }
-
- @Override
- public Map getClientMetadata() {
- return clientMetadata;
- }
-
- public void setClientMetadata(Map clientMetadata) {
- this.clientMetadata = clientMetadata;
- }
-
- @Override
- public String getClientIp() {
- return clientIp;
- }
-
- public void setClientIp(String clientIp) {
- this.clientIp = clientIp;
- }
-
- @Override
- public String getClientInterfaceName() {
- return clientInterfaceName;
- }
-
- public void setClientInterfaceName(String clientInterfaceName) {
- this.clientInterfaceName = clientInterfaceName;
- }
-
- @Override
- public int getClientPort() {
- return clientPort;
- }
-
- public void setClientPort(int clientPort) {
- this.clientPort = clientPort;
- }
-
- @Override
- public String toString() {
- return "AnsProperties{" + "doms='" + clientDomains + '\'' + ", weight="
- + clientWeight + ", weights=" + clientWeights + ", token='" + clientToken
- + '\'' + ", tokens=" + clientTokens + ", cluster='" + clientCluster + '\''
- + ", metadata=" + clientMetadata + ", registerEnabled=" + registerEnabled
- + ", ip='" + clientIp + '\'' + ", interfaceName='" + clientInterfaceName
- + '\'' + ", port=" + clientPort + ", env='" + env + '\'' + ", secure="
- + secure + ", tags=" + tags + '}';
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/edas/EdasContextAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/edas/EdasContextAutoConfiguration.java
deleted file mode 100644
index badb7ee6..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/edas/EdasContextAutoConfiguration.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.edas;
-
-import com.alibaba.alicloud.context.AliCloudContextAutoConfiguration;
-import com.alibaba.alicloud.context.AliCloudProperties;
-import com.alibaba.cloud.context.edas.AliCloudEdasSdk;
-import com.alibaba.cloud.context.edas.AliCloudEdasSdkFactory;
-
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author xiaolongzuo
- */
-@Configuration(proxyBeanMethods = false)
-@EnableConfigurationProperties(EdasProperties.class)
-@ImportAutoConfiguration(AliCloudContextAutoConfiguration.class)
-public class EdasContextAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- @ConditionalOnClass(name = "com.aliyuncs.edas.model.v20170801.GetSecureTokenRequest")
- public AliCloudEdasSdk aliCloudEdasSdk(AliCloudProperties aliCloudProperties,
- EdasProperties edasProperties) {
- return AliCloudEdasSdkFactory.getDefaultAliCloudEdasSdk(aliCloudProperties,
- edasProperties.getRegionId());
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/edas/EdasProperties.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/edas/EdasProperties.java
deleted file mode 100644
index 8cc4ffe9..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/edas/EdasProperties.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.edas;
-
-import com.alibaba.cloud.context.edas.EdasConfiguration;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * @author xiaolongzuo
- */
-@ConfigurationProperties("spring.cloud.alicloud.edas")
-public class EdasProperties implements EdasConfiguration {
-
- private static final String DEFAULT_APPLICATION_NAME = "";
-
- /**
- * edas application name.
- */
- @Value("${spring.application.name:${spring.cloud.alicloud.edas.application.name:}}")
- private String applicationName;
-
- /**
- * edas namespace.
- */
- private String namespace;
-
- /**
- * whether or not connect edas.
- */
- private boolean enabled;
-
- @Override
- public String getRegionId() {
- if (namespace == null) {
- return null;
- }
- return namespace.contains(":") ? namespace.split(":")[0] : namespace;
- }
-
- @Override
- public boolean isApplicationNameValid() {
- return !DEFAULT_APPLICATION_NAME.equals(applicationName);
- }
-
- @Override
- public String getApplicationName() {
- return applicationName;
- }
-
- public void setApplicationName(String applicationName) {
- this.applicationName = applicationName;
- }
-
- @Override
- public String getNamespace() {
- return namespace;
- }
-
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- @Override
- public boolean isEnabled() {
- return enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/listener/AbstractOnceApplicationListener.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/listener/AbstractOnceApplicationListener.java
deleted file mode 100644
index bff31292..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/listener/AbstractOnceApplicationListener.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.listener;
-
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationEvent;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.event.ApplicationContextEvent;
-
-/**
- * @author xiaolongzuo
- */
-public abstract class AbstractOnceApplicationListener
- implements ApplicationListener {
-
- private static final String BOOTSTRAP_CONFIG_NAME_VALUE = "bootstrap";
-
- private static final String BOOTSTRAP_CONFIG_NAME_KEY = "spring.config.name";
-
- private static ConcurrentHashMap, AtomicBoolean> lockMap = new ConcurrentHashMap<>();
-
- @Override
- public void onApplicationEvent(T event) {
- if (event instanceof ApplicationContextEvent) {
- ApplicationContext applicationContext = ((ApplicationContextEvent) event)
- .getApplicationContext();
- // skip bootstrap context or super parent context.
- if (BOOTSTRAP_CONFIG_NAME_VALUE.equals(applicationContext.getEnvironment()
- .getProperty(BOOTSTRAP_CONFIG_NAME_KEY))) {
- return;
- }
- }
- Class> clazz = getClass();
- lockMap.putIfAbsent(clazz, new AtomicBoolean(false));
- AtomicBoolean handled = lockMap.get(clazz);
- // only execute once.
- if (!handled.compareAndSet(false, true)) {
- return;
- }
- if (conditionalOnClass() != null) {
- try {
- Class.forName(conditionalOnClass());
- }
- catch (ClassNotFoundException e) {
- // ignored
- return;
- }
- }
- handleEvent(event);
- }
-
- /**
- * handle event.
- * @param event event
- */
- protected abstract void handleEvent(T event);
-
- /**
- * condition on class.
- * @return class name
- */
- protected String conditionalOnClass() {
- return null;
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/nacos/NacosConfigParameterInitListener.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/nacos/NacosConfigParameterInitListener.java
deleted file mode 100644
index a6585a1c..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/nacos/NacosConfigParameterInitListener.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.nacos;
-
-import com.alibaba.alicloud.context.listener.AbstractOnceApplicationListener;
-import com.alibaba.cloud.context.edas.EdasChangeOrderConfiguration;
-import com.alibaba.cloud.context.edas.EdasChangeOrderConfigurationFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
-
-/**
- * @author pbting
- */
-public class NacosConfigParameterInitListener
- extends AbstractOnceApplicationListener {
-
- private static final Logger log = LoggerFactory
- .getLogger(NacosConfigParameterInitListener.class);
-
- @Override
- protected String conditionalOnClass() {
- return "com.alibaba.cloud.nacos.NacosConfigAutoConfiguration";
- }
-
- @Override
- protected void handleEvent(ApplicationEnvironmentPreparedEvent event) {
- preparedNacosConfiguration();
- }
-
- private void preparedNacosConfiguration() {
- EdasChangeOrderConfiguration edasChangeOrderConfiguration = EdasChangeOrderConfigurationFactory
- .getEdasChangeOrderConfiguration();
-
- if (log.isDebugEnabled()) {
- log.debug("Initialize Nacos Config Parameter ,is managed {}.",
- edasChangeOrderConfiguration.isEdasManaged());
- }
-
- if (!edasChangeOrderConfiguration.isEdasManaged()) {
- return;
- }
-
- System.getProperties().setProperty("spring.cloud.nacos.config.server-mode",
- "EDAS");
- // initialize nacos configuration
- System.getProperties().setProperty("spring.cloud.nacos.config.server-addr", "");
- System.getProperties().setProperty("spring.cloud.nacos.config.endpoint",
- edasChangeOrderConfiguration.getAddressServerDomain());
- System.getProperties().setProperty("spring.cloud.nacos.config.namespace",
- edasChangeOrderConfiguration.getTenantId());
- System.getProperties().setProperty("spring.cloud.nacos.config.access-key",
- edasChangeOrderConfiguration.getDauthAccessKey());
- System.getProperties().setProperty("spring.cloud.nacos.config.secret-key",
- edasChangeOrderConfiguration.getDauthSecretKey());
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/nacos/NacosDiscoveryParameterInitListener.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/nacos/NacosDiscoveryParameterInitListener.java
deleted file mode 100644
index 145605e3..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/nacos/NacosDiscoveryParameterInitListener.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.nacos;
-
-import java.util.Properties;
-
-import com.alibaba.alicloud.context.listener.AbstractOnceApplicationListener;
-import com.alibaba.cloud.context.edas.EdasChangeOrderConfiguration;
-import com.alibaba.cloud.context.edas.EdasChangeOrderConfigurationFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
-
-/**
- * @author pbting
- * @date 2019-02-14 11:12 AM
- */
-public class NacosDiscoveryParameterInitListener
- extends AbstractOnceApplicationListener {
-
- private static final Logger log = LoggerFactory
- .getLogger(NacosDiscoveryParameterInitListener.class);
-
- @Override
- protected String conditionalOnClass() {
- return "com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration";
- }
-
- @Override
- protected void handleEvent(ApplicationEnvironmentPreparedEvent event) {
- EdasChangeOrderConfiguration edasChangeOrderConfiguration = EdasChangeOrderConfigurationFactory
- .getEdasChangeOrderConfiguration();
-
- if (log.isDebugEnabled()) {
- log.debug("Initialize Nacos Discovery Parameter ,is managed {}.",
- edasChangeOrderConfiguration.isEdasManaged());
- }
-
- if (!edasChangeOrderConfiguration.isEdasManaged()) {
- return;
- }
- // initialize nacos configuration
- Properties properties = System.getProperties();
- properties.setProperty("spring.cloud.nacos.discovery.server-mode", "EDAS");
- // step 1: set some properties for spring cloud alibaba nacos discovery
- properties.setProperty("spring.cloud.nacos.discovery.server-addr", "");
- properties.setProperty("spring.cloud.nacos.discovery.endpoint",
- edasChangeOrderConfiguration.getAddressServerDomain());
- properties.setProperty("spring.cloud.nacos.discovery.namespace",
- edasChangeOrderConfiguration.getTenantId());
- properties.setProperty("spring.cloud.nacos.discovery.access-key",
- edasChangeOrderConfiguration.getDauthAccessKey());
- properties.setProperty("spring.cloud.nacos.discovery.secret-key",
- edasChangeOrderConfiguration.getDauthSecretKey());
-
- // step 2: set these properties for nacos client
- properties.setProperty("nacos.naming.web.context", "/vipserver");
- properties.setProperty("nacos.naming.exposed.port", "80");
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/oss/OssContextAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/oss/OssContextAutoConfiguration.java
deleted file mode 100644
index a50e6d03..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/oss/OssContextAutoConfiguration.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.oss;
-
-import com.alibaba.alicloud.context.AliCloudContextAutoConfiguration;
-import com.alibaba.alicloud.context.AliCloudProperties;
-import com.alibaba.cloud.context.AliCloudAuthorizationMode;
-import com.aliyun.oss.OSS;
-import com.aliyun.oss.OSSClientBuilder;
-
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.util.Assert;
-import org.springframework.util.StringUtils;
-
-/**
- * OSS Auto {@link Configuration}.
- *
- * @author Jim
- * @author xiaolongzuo
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnClass(name = "com.alibaba.alicloud.oss.OssAutoConfiguration")
-@ConditionalOnProperty(name = "spring.cloud.alicloud.oss.enabled", matchIfMissing = true)
-@EnableConfigurationProperties(OssProperties.class)
-@ImportAutoConfiguration(AliCloudContextAutoConfiguration.class)
-public class OssContextAutoConfiguration {
-
- @ConditionalOnMissingBean
- @Bean
- public OSS ossClient(AliCloudProperties aliCloudProperties,
- OssProperties ossProperties) {
- if (ossProperties.getAuthorizationMode() == AliCloudAuthorizationMode.AK_SK) {
- Assert.isTrue(!StringUtils.isEmpty(ossProperties.getEndpoint()),
- "Oss endpoint can't be empty.");
- Assert.isTrue(!StringUtils.isEmpty(aliCloudProperties.getAccessKey()),
- "${spring.cloud.alicloud.access-key} can't be empty.");
- Assert.isTrue(!StringUtils.isEmpty(aliCloudProperties.getSecretKey()),
- "${spring.cloud.alicloud.secret-key} can't be empty.");
- return new OSSClientBuilder().build(ossProperties.getEndpoint(),
- aliCloudProperties.getAccessKey(), aliCloudProperties.getSecretKey(),
- ossProperties.getConfig());
- }
- else if (ossProperties.getAuthorizationMode() == AliCloudAuthorizationMode.STS) {
- Assert.isTrue(!StringUtils.isEmpty(ossProperties.getEndpoint()),
- "Oss endpoint can't be empty.");
- Assert.isTrue(!StringUtils.isEmpty(ossProperties.getSts().getAccessKey()),
- "Access key can't be empty.");
- Assert.isTrue(!StringUtils.isEmpty(ossProperties.getSts().getSecretKey()),
- "Secret key can't be empty.");
- Assert.isTrue(!StringUtils.isEmpty(ossProperties.getSts().getSecurityToken()),
- "Security Token can't be empty.");
- return new OSSClientBuilder().build(ossProperties.getEndpoint(),
- ossProperties.getSts().getAccessKey(),
- ossProperties.getSts().getSecretKey(),
- ossProperties.getSts().getSecurityToken(), ossProperties.getConfig());
- }
- else {
- throw new IllegalArgumentException("Unknown auth mode.");
- }
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/oss/OssProperties.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/oss/OssProperties.java
deleted file mode 100644
index 468a485e..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/oss/OssProperties.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.oss;
-
-import com.alibaba.cloud.context.AliCloudAuthorizationMode;
-import com.aliyun.oss.ClientBuilderConfiguration;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * {@link ConfigurationProperties} for configuring OSS.
- *
- * @author Jim
- * @author xiaolongzuo
- */
-@ConfigurationProperties("spring.cloud.alicloud.oss")
-public class OssProperties {
-
- /**
- * Authorization Mode, please see oss
- * docs.
- */
- @Value("${spring.cloud.alicloud.oss.authorization-mode:AK_SK}")
- private AliCloudAuthorizationMode authorizationMode;
-
- /**
- * Endpoint, please see oss
- * docs.
- */
- private String endpoint;
-
- /**
- * Sts token, please see oss
- * docs.
- */
- private StsToken sts;
-
- /**
- * Client Configuration, please see oss
- * docs.
- */
- private ClientBuilderConfiguration config;
-
- public AliCloudAuthorizationMode getAuthorizationMode() {
- return authorizationMode;
- }
-
- public void setAuthorizationMode(AliCloudAuthorizationMode authorizationMode) {
- this.authorizationMode = authorizationMode;
- }
-
- public ClientBuilderConfiguration getConfig() {
- return config;
- }
-
- public void setConfig(ClientBuilderConfiguration config) {
- this.config = config;
- }
-
- public String getEndpoint() {
- return endpoint;
- }
-
- public void setEndpoint(String endpoint) {
- this.endpoint = endpoint;
- }
-
- public StsToken getSts() {
- return sts;
- }
-
- public void setSts(StsToken sts) {
- this.sts = sts;
- }
-
- public static class StsToken {
-
- private String accessKey;
-
- private String secretKey;
-
- private String securityToken;
-
- public String getAccessKey() {
- return accessKey;
- }
-
- public void setAccessKey(String accessKey) {
- this.accessKey = accessKey;
- }
-
- public String getSecretKey() {
- return secretKey;
- }
-
- public void setSecretKey(String secretKey) {
- this.secretKey = secretKey;
- }
-
- public String getSecurityToken() {
- return securityToken;
- }
-
- public void setSecurityToken(String securityToken) {
- this.securityToken = securityToken;
- }
-
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/scx/ScxContextAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/scx/ScxContextAutoConfiguration.java
deleted file mode 100644
index 62cc85ea..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/scx/ScxContextAutoConfiguration.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.scx;
-
-import com.alibaba.alicloud.context.AliCloudProperties;
-import com.alibaba.alicloud.context.edas.EdasContextAutoConfiguration;
-import com.alibaba.alicloud.context.edas.EdasProperties;
-import com.alibaba.cloud.context.edas.AliCloudEdasSdk;
-import com.alibaba.cloud.context.scx.AliCloudScxInitializer;
-import com.alibaba.edas.schedulerx.SchedulerXClient;
-
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author xiaolongzuo
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnClass(name = "com.alibaba.alicloud.scx.ScxAutoConfiguration")
-@ConditionalOnProperty(name = "spring.cloud.alicloud.scx.enabled", matchIfMissing = true)
-@EnableConfigurationProperties(ScxProperties.class)
-@ImportAutoConfiguration(EdasContextAutoConfiguration.class)
-public class ScxContextAutoConfiguration {
-
- @Bean(initMethod = "init")
- @ConditionalOnMissingBean
- public SchedulerXClient schedulerXClient(AliCloudProperties aliCloudProperties,
- EdasProperties edasProperties, ScxProperties scxProperties,
- AliCloudEdasSdk aliCloudEdasSdk) {
- return AliCloudScxInitializer.initialize(aliCloudProperties, edasProperties,
- scxProperties, aliCloudEdasSdk);
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/scx/ScxProperties.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/scx/ScxProperties.java
deleted file mode 100644
index 1fdce76d..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/scx/ScxProperties.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.scx;
-
-import com.alibaba.cloud.context.scx.ScxConfiguration;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * @author xiaolongzuo
- */
-@ConfigurationProperties("spring.cloud.alicloud.scx")
-public class ScxProperties implements ScxConfiguration {
-
- /**
- * Group id, please see scx
- * docs.
- */
- private String groupId;
-
- /**
- * Domain name, please see scx
- * docs.
- */
- private String domainName;
-
- @Override
- public String getGroupId() {
- return groupId;
- }
-
- public void setGroupId(String groupId) {
- this.groupId = groupId;
- }
-
- @Override
- public String getDomainName() {
- return domainName;
- }
-
- public void setDomainName(String domainName) {
- this.domainName = domainName;
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/sentinel/SentinelAliCloudListener.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/sentinel/SentinelAliCloudListener.java
deleted file mode 100644
index 29dc9637..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/sentinel/SentinelAliCloudListener.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.sentinel;
-
-import com.alibaba.alicloud.context.Constants;
-import com.alibaba.alicloud.context.listener.AbstractOnceApplicationListener;
-import com.alibaba.cloud.context.edas.EdasChangeOrderConfiguration;
-import com.alibaba.cloud.context.edas.EdasChangeOrderConfigurationFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
-
-/**
- * @author Jim
- */
-public class SentinelAliCloudListener
- extends AbstractOnceApplicationListener {
-
- private static final Logger logger = LoggerFactory
- .getLogger(SentinelAliCloudListener.class);
-
- @Override
- protected void handleEvent(ApplicationEnvironmentPreparedEvent event) {
- EdasChangeOrderConfiguration edasChangeOrderConfiguration = EdasChangeOrderConfigurationFactory
- .getEdasChangeOrderConfiguration();
- logger.info("Sentinel Nacos datasource will"
- + (edasChangeOrderConfiguration.isEdasManaged() ? " be " : " not be ")
- + "changed by edas change order.");
- if (!edasChangeOrderConfiguration.isEdasManaged()) {
- return;
- }
- System.getProperties().setProperty(Constants.Sentinel.NACOS_DATASOURCE_ENDPOINT,
- edasChangeOrderConfiguration.getAddressServerDomain());
- System.getProperties().setProperty(Constants.Sentinel.NACOS_DATASOURCE_NAMESPACE,
- edasChangeOrderConfiguration.getTenantId());
- System.getProperties().setProperty(Constants.Sentinel.NACOS_DATASOURCE_AK,
- edasChangeOrderConfiguration.getDauthAccessKey());
- System.getProperties().setProperty(Constants.Sentinel.NACOS_DATASOURCE_SK,
- edasChangeOrderConfiguration.getDauthSecretKey());
- System.getProperties().setProperty(Constants.Sentinel.PROJECT_NAME,
- edasChangeOrderConfiguration.getProjectName());
- }
-
- @Override
- protected String conditionalOnClass() {
- return "com.alibaba.csp.sentinel.datasource.nacos.NacosDataSource";
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/sms/SmsContextAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/sms/SmsContextAutoConfiguration.java
deleted file mode 100644
index dd49c578..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/sms/SmsContextAutoConfiguration.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.sms;
-
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author pbting
- * @author xiaolongzuo
- */
-@Configuration(proxyBeanMethods = false)
-@EnableConfigurationProperties(SmsProperties.class)
-@ConditionalOnClass(name = "com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest")
-@ConditionalOnProperty(name = "spring.cloud.alicloud.sms.enabled", matchIfMissing = true)
-public class SmsContextAutoConfiguration {
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/sms/SmsProperties.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/sms/SmsProperties.java
deleted file mode 100644
index 3f1fc961..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/sms/SmsProperties.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.sms;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * @author pbting
- * @author xiaolongzuo
- */
-@ConfigurationProperties(prefix = "spring.cloud.alicloud.sms")
-public class SmsProperties {
-
- /**
- * Product name.
- */
- public static final String SMS_PRODUCT = "Dysmsapi";
-
- /**
- * Product domain.
- */
- public static final String SMS_DOMAIN = "dysmsapi.aliyuncs.com";
-
- /**
- * Report queue name.
- */
- private String reportQueueName;
-
- /**
- * Up queue name.
- */
- private String upQueueName;
-
- /**
- * Connect timeout.
- */
- private String connectTimeout = "10000";
-
- /**
- * Read timeout.
- */
- private String readTimeout = "10000";
-
- public String getConnectTimeout() {
- return connectTimeout;
- }
-
- public void setConnectTimeout(String connectTimeout) {
- this.connectTimeout = connectTimeout;
- }
-
- public String getReadTimeout() {
- return readTimeout;
- }
-
- public void setReadTimeout(String readTimeout) {
- this.readTimeout = readTimeout;
- }
-
- public String getReportQueueName() {
- return reportQueueName;
- }
-
- public void setReportQueueName(String reportQueueName) {
- this.reportQueueName = reportQueueName;
- }
-
- public String getUpQueueName() {
- return upQueueName;
- }
-
- public void setUpQueueName(String upQueueName) {
- this.upQueueName = upQueueName;
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/statistics/StatisticsTaskStarter.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/statistics/StatisticsTaskStarter.java
deleted file mode 100644
index 412f8c11..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/java/com/alibaba/alicloud/context/statistics/StatisticsTaskStarter.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.statistics;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.alibaba.alicloud.context.acm.AcmContextBootstrapConfiguration;
-import com.alibaba.alicloud.context.acm.AcmProperties;
-import com.alibaba.alicloud.context.ans.AnsContextAutoConfiguration;
-import com.alibaba.alicloud.context.ans.AnsProperties;
-import com.alibaba.alicloud.context.edas.EdasProperties;
-import com.alibaba.alicloud.context.oss.OssContextAutoConfiguration;
-import com.alibaba.alicloud.context.oss.OssProperties;
-import com.alibaba.alicloud.context.scx.ScxContextAutoConfiguration;
-import com.alibaba.alicloud.context.scx.ScxProperties;
-import com.alibaba.cloud.context.AliCloudServerMode;
-import com.alibaba.cloud.context.edas.AliCloudEdasSdk;
-import com.alibaba.cloud.context.statistics.StatisticsTask;
-
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author xiaolongzuo
- */
-@Configuration(proxyBeanMethods = false)
-@AutoConfigureAfter({ ScxContextAutoConfiguration.class,
- OssContextAutoConfiguration.class, AnsContextAutoConfiguration.class,
- AcmContextBootstrapConfiguration.class })
-public class StatisticsTaskStarter implements InitializingBean {
-
- private static final String NACOS_CONFIG_SERVER_MODE_KEY = "spring.cloud.nacos.config.server-mode";
-
- private static final String NACOS_DISCOVERY_SERVER_MODE_KEY = "spring.cloud.nacos.discovery.server-mode";
-
- private static final String NACOS_SERVER_MODE_VALUE = "EDAS";
-
- @Autowired(required = false)
- private AliCloudEdasSdk aliCloudEdasSdk;
-
- @Autowired(required = false)
- private EdasProperties edasProperties;
-
- @Autowired(required = false)
- private ScxProperties scxProperties;
-
- @Autowired(required = false)
- private OssProperties ossProperties;
-
- @Autowired(required = false)
- private AnsProperties ansProperties;
-
- @Autowired(required = false)
- private AcmProperties acmProperties;
-
- @Autowired(required = false)
- private ScxContextAutoConfiguration scxContextAutoConfiguration;
-
- @Autowired(required = false)
- private OssContextAutoConfiguration ossContextAutoConfiguration;
-
- @Autowired(required = false)
- private AnsContextAutoConfiguration ansContextAutoConfiguration;
-
- @Autowired(required = false)
- private AcmContextBootstrapConfiguration acmContextBootstrapConfiguration;
-
- @Override
- public void afterPropertiesSet() {
- StatisticsTask statisticsTask = new StatisticsTask(aliCloudEdasSdk,
- edasProperties, getComponents());
- statisticsTask.start();
- }
-
- private List getComponents() {
- List components = new ArrayList<>();
- if (scxContextAutoConfiguration != null && scxProperties != null) {
- components.add("SC-SCX");
- }
- if (ossContextAutoConfiguration != null && ossProperties != null) {
- components.add("SC-OSS");
- }
- boolean edasEnabled = edasProperties != null && edasProperties.isEnabled();
- boolean ansEnableEdas = edasEnabled || (ansProperties != null
- && ansProperties.getServerMode() == AliCloudServerMode.EDAS);
- if (ansContextAutoConfiguration != null && ansEnableEdas) {
- components.add("SC-ANS");
- }
- boolean acmEnableEdas = edasEnabled || (acmProperties != null
- && acmProperties.getServerMode() == AliCloudServerMode.EDAS);
- if (acmContextBootstrapConfiguration != null && acmEnableEdas) {
- components.add("SC-ACM");
- }
- if (NACOS_SERVER_MODE_VALUE
- .equals(System.getProperty(NACOS_CONFIG_SERVER_MODE_KEY))) {
- components.add("SC-NACOS-CONFIG");
- }
- if (NACOS_SERVER_MODE_VALUE
- .equals(System.getProperty(NACOS_DISCOVERY_SERVER_MODE_KEY))) {
- components.add("SC-NACOS-DISCOVERY");
- }
- return components;
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/resources/META-INF/additional-spring-configuration-metadata.json
deleted file mode 100644
index 2b81aad2..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/resources/META-INF/additional-spring-configuration-metadata.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "properties": [
- {
- "name": "spring.cloud.alicloud.ans.client-domains",
- "type": "java.lang.String",
- "defaultValue": "",
- "description": "Service name list, default value is ${spring.application.name}."
- },
- {
- "name": "spring.cloud.alicloud.ans.env",
- "type": "java.lang.String",
- "defaultValue": "DEFAULT",
- "description": "The env for ans, default value is DEFAULT."
- }
- ]
-}
\ No newline at end of file
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/resources/META-INF/spring.factories b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index 8c6c9957..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1,15 +0,0 @@
-org.springframework.cloud.bootstrap.BootstrapConfiguration=\
- com.alibaba.alicloud.context.acm.AcmContextBootstrapConfiguration
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
- com.alibaba.alicloud.context.AliCloudContextAutoConfiguration,\
- com.alibaba.alicloud.context.edas.EdasContextAutoConfiguration,\
- com.alibaba.alicloud.context.ans.AnsContextAutoConfiguration,\
- com.alibaba.alicloud.context.oss.OssContextAutoConfiguration,\
- com.alibaba.alicloud.context.scx.ScxContextAutoConfiguration,\
- com.alibaba.alicloud.context.statistics.StatisticsTaskStarter,\
- com.alibaba.alicloud.context.sms.SmsContextAutoConfiguration
-org.springframework.context.ApplicationListener=\
- com.alibaba.alicloud.context.ans.AnsContextApplicationListener,\
- com.alibaba.alicloud.context.nacos.NacosConfigParameterInitListener,\
- com.alibaba.alicloud.context.nacos.NacosDiscoveryParameterInitListener,\
- com.alibaba.alicloud.context.sentinel.SentinelAliCloudListener
\ No newline at end of file
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/acm/AcmAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/acm/AcmAutoConfiguration.java
deleted file mode 100644
index 93810221..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/acm/AcmAutoConfiguration.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.acm;
-
-/**
- * @author xiaolongzuo
- */
-public class AcmAutoConfiguration {
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/ans/AnsAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/ans/AnsAutoConfiguration.java
deleted file mode 100644
index 9f472639..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/ans/AnsAutoConfiguration.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.ans;
-
-/**
- * @author xiaolongzuo
- */
-public class AnsAutoConfiguration {
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/AliCloudPropertiesTests.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/AliCloudPropertiesTests.java
deleted file mode 100644
index e2b1d51c..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/AliCloudPropertiesTests.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context;
-
-import org.junit.Test;
-
-import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.test.context.runner.ApplicationContextRunner;
-
-import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
-
-/**
- * @author xiaolongzuo
- */
-public class AliCloudPropertiesTests {
-
- private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
- .withConfiguration(
- AutoConfigurations.of(AliCloudContextAutoConfiguration.class));
-
- @Test
- public void testConfigurationValueDefaultsAreAsExpected() {
- this.contextRunner.run(context -> {
- AliCloudProperties aliCloudProperties = context
- .getBean(AliCloudProperties.class);
- assertThat(aliCloudProperties.getAccessKey()).isNull();
- assertThat(aliCloudProperties.getSecretKey()).isNull();
- });
- }
-
- @Test
- public void testConfigurationValuesAreCorrectlyLoaded() {
- this.contextRunner.withPropertyValues("spring.cloud.alicloud.access-key=123",
- "spring.cloud.alicloud.secret-key=123456").run(context -> {
- AliCloudProperties aliCloudProperties = context
- .getBean(AliCloudProperties.class);
- assertThat(aliCloudProperties.getAccessKey()).isEqualTo("123");
- assertThat(aliCloudProperties.getSecretKey()).isEqualTo("123456");
- });
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/BaseAliCloudSpringApplication.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/BaseAliCloudSpringApplication.java
deleted file mode 100644
index 9634b647..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/BaseAliCloudSpringApplication.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context;
-
-import org.junit.runner.RunWith;
-import org.powermock.core.classloader.annotations.PowerMockIgnore;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.powermock.modules.junit4.PowerMockRunnerDelegate;
-
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-/**
- * @author xiaolongzuo
- */
-@RunWith(PowerMockRunner.class)
-@PowerMockRunnerDelegate(SpringRunner.class)
-@PowerMockIgnore("javax.management.*")
-@SpringBootTest(classes = BaseAliCloudSpringApplication.AliCloudApplication.class,
- properties = { "spring.application.name=myapp",
- "spring.cloud.alicloud.edas.application.name=myapp",
- "spring.cloud.alicloud.access-key=ak",
- "spring.cloud.alicloud.secret-key=sk",
- "spring.cloud.alicloud.oss.endpoint=test",
- "spring.cloud.alicloud.scx.group-id=1-2-3-4",
- "spring.cloud.alicloud.edas.namespace=cn-test",
- "spring.cloud.alicloud.ans.server-list=192.168.1.100",
- "spring.cloud.alicloud.ans.server-port=8888",
- "spring.cloud.alicloud.oss.enabled=false",
- "spring.cloud.alicloud.scx.enabled=false" })
-public abstract class BaseAliCloudSpringApplication {
-
- @SpringBootApplication
- public static class AliCloudApplication {
-
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/acm/AcmPropertiesTests.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/acm/AcmPropertiesTests.java
deleted file mode 100644
index 55339edb..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/acm/AcmPropertiesTests.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.acm;
-
-import com.alibaba.alicloud.context.AliCloudContextAutoConfiguration;
-import com.alibaba.alicloud.context.edas.EdasContextAutoConfiguration;
-import com.alibaba.cloud.context.AliCloudServerMode;
-import org.junit.Test;
-
-import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.test.context.runner.ApplicationContextRunner;
-
-import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
-
-/**
- * @author xiaolongzuo
- */
-public class AcmPropertiesTests {
-
- private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
- .withConfiguration(
- AutoConfigurations.of(AcmContextBootstrapConfiguration.class,
- EdasContextAutoConfiguration.class,
- AliCloudContextAutoConfiguration.class));
-
- @Test
- public void testConfigurationValueDefaultsAreAsExpected() {
- this.contextRunner.withPropertyValues("spring.application.name=myapp")
- .run(context -> {
- AcmProperties config = context.getBean(AcmProperties.class);
- assertThat(config.getServerMode())
- .isEqualTo(AliCloudServerMode.LOCAL);
- assertThat(config.getServerList()).isEqualTo("127.0.0.1");
- assertThat(config.getServerPort()).isEqualTo("8080");
- assertThat(config.getEndpoint()).isNull();
- assertThat(config.getFileExtension()).isEqualTo("properties");
- assertThat(config.getGroup()).isEqualTo("DEFAULT_GROUP");
- assertThat(config.getNamespace()).isNull();
- assertThat(config.getRamRoleName()).isNull();
- assertThat(config.getTimeout()).isEqualTo(3000);
- });
- }
-
- @Test
- public void testConfigurationValuesAreCorrectlyLoaded() {
- this.contextRunner.withPropertyValues("spring.application.name=myapp",
- "spring.cloud.alicloud.access-key=ak",
- "spring.cloud.alicloud.secret-key=sk",
- "spring.cloud.alicloud.acm.server-mode=EDAS",
- "spring.cloud.alicloud.acm.server-port=11111",
- "spring.cloud.alicloud.acm.server-list=10.10.10.10",
- "spring.cloud.alicloud.acm.namespace=testNamespace",
- "spring.cloud.alicloud.acm.endpoint=testDomain",
- "spring.cloud.alicloud.acm.group=testGroup",
- "spring.cloud.alicloud.acm.file-extension=yaml").run(context -> {
- AcmProperties acmProperties = context.getBean(AcmProperties.class);
- assertThat(acmProperties.getServerMode())
- .isEqualTo(AliCloudServerMode.EDAS);
- assertThat(acmProperties.getServerList()).isEqualTo("10.10.10.10");
- assertThat(acmProperties.getServerPort()).isEqualTo("11111");
- assertThat(acmProperties.getEndpoint()).isEqualTo("testDomain");
- assertThat(acmProperties.getGroup()).isEqualTo("testGroup");
- assertThat(acmProperties.getFileExtension()).isEqualTo("yaml");
- assertThat(acmProperties.getNamespace()).isEqualTo("testNamespace");
- });
- }
-
- @Test
- public void testAcmIntegrationConfigurationValuesAreCorrectlyLoaded() {
- this.contextRunner.withPropertyValues("spring.application.name=myapp",
- "spring.application.group=com.alicloud.test",
- "spring.cloud.alicloud.access-key=ak",
- "spring.cloud.alicloud.secret-key=sk",
- "spring.cloud.alicloud.acm.server-mode=EDAS",
- "spring.cloud.alicloud.acm.server-port=11111",
- "spring.cloud.alicloud.acm.server-list=10.10.10.10",
- "spring.cloud.alicloud.acm.namespace=testNamespace",
- "spring.cloud.alicloud.acm.endpoint=testDomain",
- "spring.cloud.alicloud.acm.group=testGroup",
- "spring.cloud.alicloud.acm.file-extension=yaml").run(context -> {
- AcmIntegrationProperties acmIntegrationProperties = context
- .getBean(AcmIntegrationProperties.class);
- assertThat(acmIntegrationProperties.getGroupConfigurationDataIds()
- .size()).isEqualTo(2);
- assertThat(acmIntegrationProperties
- .getApplicationConfigurationDataIds().size()).isEqualTo(2);
- });
- }
-
- @Test
- public void testAcmIntegrationConfigurationValuesAreCorrectlyLoaded2() {
- this.contextRunner.withPropertyValues("spring.application.name=myapp",
- "spring.application.group=com.alicloud.test",
- "spring.profiles.active=profile1,profile2",
- "spring.cloud.alicloud.access-key=ak",
- "spring.cloud.alicloud.secret-key=sk",
- "spring.cloud.alicloud.acm.server-mode=EDAS",
- "spring.cloud.alicloud.acm.server-port=11111",
- "spring.cloud.alicloud.acm.server-list=10.10.10.10",
- "spring.cloud.alicloud.acm.namespace=testNamespace",
- "spring.cloud.alicloud.acm.endpoint=testDomain",
- "spring.cloud.alicloud.acm.group=testGroup",
- "spring.cloud.alicloud.acm.file-extension=yaml").run(context -> {
- AcmIntegrationProperties acmIntegrationProperties = context
- .getBean(AcmIntegrationProperties.class);
- assertThat(acmIntegrationProperties.getGroupConfigurationDataIds()
- .size()).isEqualTo(2);
- assertThat(acmIntegrationProperties
- .getApplicationConfigurationDataIds().size()).isEqualTo(6);
- });
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/ans/AnsContextApplicationListenerTests.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/ans/AnsContextApplicationListenerTests.java
deleted file mode 100644
index f39f2ff6..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/ans/AnsContextApplicationListenerTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.ans;
-
-import com.alibaba.alicloud.context.BaseAliCloudSpringApplication;
-import org.junit.Test;
-
-import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
-
-/**
- * @author xiaolongzuo
- */
-public class AnsContextApplicationListenerTests extends BaseAliCloudSpringApplication {
-
- @Test
- public void testAnsContextApplicationListenerDefault() {
- assertThat(System
- .getProperty("com.alibaba.ans.shaded.com.taobao.vipserver.serverlist"))
- .isEqualTo("192.168.1.100");
- assertThat(System.getProperty("vipserver.server.port")).isEqualTo("8888");
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/ans/AnsPropertiesTests.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/ans/AnsPropertiesTests.java
deleted file mode 100644
index 3b7859e2..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/ans/AnsPropertiesTests.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.ans;
-
-import java.net.Inet4Address;
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.net.SocketException;
-import java.util.Vector;
-
-import com.alibaba.alicloud.context.AliCloudContextAutoConfiguration;
-import com.alibaba.alicloud.context.edas.EdasContextAutoConfiguration;
-import com.alibaba.cloud.context.AliCloudServerMode;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.test.context.runner.ApplicationContextRunner;
-
-import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
-
-/**
- * @author xiaolongzuo
- */
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({ NetworkInterface.class, AnsProperties.class })
-public class AnsPropertiesTests {
-
- private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
- .withConfiguration(AutoConfigurations.of(AnsContextAutoConfiguration.class,
- EdasContextAutoConfiguration.class,
- AliCloudContextAutoConfiguration.class));
-
- @Test
- public void testConfigurationValueDefaultsAreAsExpected() {
- this.contextRunner.withPropertyValues().run(context -> {
- AnsProperties ansProperties = context.getBean(AnsProperties.class);
- assertThat(ansProperties.getServerMode()).isEqualTo(AliCloudServerMode.LOCAL);
- assertThat(ansProperties.getServerList()).isEqualTo("127.0.0.1");
- assertThat(ansProperties.getServerPort()).isEqualTo("8080");
- assertThat(ansProperties.getClientDomains()).isEqualTo("");
- assertThat(ansProperties.getClientWeight()).isEqualTo(1.0F);
- assertThat(ansProperties.getClientWeights().size()).isEqualTo(0);
- assertThat(ansProperties.getClientTokens().size()).isEqualTo(0);
- assertThat(ansProperties.getClientMetadata().size()).isEqualTo(0);
- assertThat(ansProperties.getClientToken()).isNull();
- assertThat(ansProperties.getClientCluster()).isEqualTo("DEFAULT");
- assertThat(ansProperties.isRegisterEnabled()).isTrue();
- assertThat(ansProperties.getClientInterfaceName()).isNull();
- assertThat(ansProperties.getClientPort()).isEqualTo(-1);
- assertThat(ansProperties.getEnv()).isEqualTo("DEFAULT");
- assertThat(ansProperties.isSecure()).isFalse();
- assertThat(ansProperties.getTags().size()).isEqualTo(1);
- assertThat(ansProperties.getTags().keySet().iterator().next())
- .isEqualTo("ANS_SERVICE_TYPE");
- assertThat(ansProperties.getTags().get("ANS_SERVICE_TYPE"))
- .isEqualTo("SPRING_CLOUD");
- });
- }
-
- @Test
- public void testConfigurationValuesAreCorrectlyLoaded1() {
- this.contextRunner
- .withPropertyValues("spring.cloud.alicloud.ans.server-mode=EDAS",
- "spring.cloud.alicloud.ans.server-port=11111",
- "spring.cloud.alicloud.ans.server-list=10.10.10.10",
- "spring.cloud.alicloud.ans.client-domains=testDomain",
- "spring.cloud.alicloud.ans.client-weight=0.9",
- "spring.cloud.alicloud.ans.client-weights.testDomain=0.9")
- .run(context -> {
- AnsProperties ansProperties = context.getBean(AnsProperties.class);
- assertThat(ansProperties.getServerMode())
- .isEqualTo(AliCloudServerMode.EDAS);
- assertThat(ansProperties.getServerList()).isEqualTo("10.10.10.10");
- assertThat(ansProperties.getServerPort()).isEqualTo("11111");
- assertThat(ansProperties.getClientDomains()).isEqualTo("testDomain");
- assertThat(ansProperties.getClientWeight()).isEqualTo(0.9F);
- assertThat(ansProperties.getClientWeights().size()).isEqualTo(1);
- assertThat(ansProperties.getClientTokens().size()).isEqualTo(0);
- assertThat(ansProperties.getClientMetadata().size()).isEqualTo(0);
- assertThat(ansProperties.getClientToken()).isNull();
- assertThat(ansProperties.getClientCluster()).isEqualTo("DEFAULT");
- assertThat(ansProperties.isRegisterEnabled()).isTrue();
- assertThat(ansProperties.getClientInterfaceName()).isNull();
- assertThat(ansProperties.getClientPort()).isEqualTo(-1);
- assertThat(ansProperties.getEnv()).isEqualTo("DEFAULT");
- assertThat(ansProperties.isSecure()).isFalse();
- assertThat(ansProperties.getTags().size()).isEqualTo(1);
- assertThat(ansProperties.getTags().keySet().iterator().next())
- .isEqualTo("ANS_SERVICE_TYPE");
- assertThat(ansProperties.getTags().get("ANS_SERVICE_TYPE"))
- .isEqualTo("SPRING_CLOUD");
- });
- }
-
- @Test(expected = RuntimeException.class)
- public void testConfigurationValuesAreCorrectlyLoaded2() {
- this.contextRunner.withPropertyValues(
- "spring.cloud.alicloud.ans.client-interface-name=noneinterfacename")
- .run(context -> {
- AnsProperties ansProperties = context.getBean(AnsProperties.class);
- assertThat(ansProperties.getClientInterfaceName())
- .isEqualTo("noneinterfacename");
- });
- }
-
- // @Test
- public void testConfigurationValuesAreCorrectlyLoaded3() throws SocketException {
- NetworkInterface networkInterface = PowerMockito.mock(NetworkInterface.class);
- Vector inetAddressList = new Vector<>();
- Inet4Address inetAddress = PowerMockito.mock(Inet4Address.class);
- PowerMockito.when(inetAddress.getHostAddress()).thenReturn("192.168.1.100");
- inetAddressList.add(inetAddress);
- PowerMockito.when(networkInterface.getInetAddresses())
- .thenReturn(inetAddressList.elements());
- PowerMockito.mockStatic(NetworkInterface.class);
- PowerMockito.when(NetworkInterface.getByName("eth0"))
- .thenReturn(networkInterface);
- this.contextRunner
- .withPropertyValues(
- "spring.cloud.alicloud.ans.client-interface-name=eth0")
- .run(context -> {
- AnsProperties ansProperties = context.getBean(AnsProperties.class);
- assertThat(ansProperties.getClientInterfaceName()).isEqualTo("eth0");
- assertThat(ansProperties.getClientIp()).isEqualTo("192.168.1.100");
- });
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/edas/EdasPropertiesTests.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/edas/EdasPropertiesTests.java
deleted file mode 100644
index bc338033..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/edas/EdasPropertiesTests.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.edas;
-
-import com.alibaba.alicloud.context.AliCloudContextAutoConfiguration;
-import org.junit.Test;
-
-import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.test.context.runner.ApplicationContextRunner;
-
-import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
-
-/**
- * @author xiaolongzuo
- */
-public class EdasPropertiesTests {
-
- private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
- .withConfiguration(AutoConfigurations.of(EdasContextAutoConfiguration.class,
- AliCloudContextAutoConfiguration.class));
-
- @Test
- public void testConfigurationValueDefaultsAreAsExpected() {
- this.contextRunner.withPropertyValues().run(context -> {
- EdasProperties edasProperties = context.getBean(EdasProperties.class);
- assertThat(edasProperties.getNamespace()).isNull();
- assertThat(edasProperties.isApplicationNameValid()).isFalse();
- });
- }
-
- @Test
- public void testConfigurationValuesAreCorrectlyLoaded1() {
- this.contextRunner
- .withPropertyValues("spring.cloud.alicloud.edas.namespace=testns",
- "spring.application.name=myapps")
- .run(context -> {
- EdasProperties edasProperties = context.getBean(EdasProperties.class);
- assertThat(edasProperties.getNamespace()).isEqualTo("testns");
- assertThat(edasProperties.getApplicationName()).isEqualTo("myapps");
- });
- }
-
- @Test
- public void testConfigurationValuesAreCorrectlyLoaded2() {
- this.contextRunner
- .withPropertyValues("spring.cloud.alicloud.edas.namespace=testns",
- "spring.cloud.alicloud.edas.application.name=myapps")
- .run(context -> {
- EdasProperties edasProperties = context.getBean(EdasProperties.class);
- assertThat(edasProperties.getNamespace()).isEqualTo("testns");
- assertThat(edasProperties.getApplicationName()).isEqualTo("myapps");
- });
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/nacos/NacosConfigParameterInitListenerTests.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/nacos/NacosConfigParameterInitListenerTests.java
deleted file mode 100644
index 221e1ff2..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/nacos/NacosConfigParameterInitListenerTests.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.nacos;
-
-import com.alibaba.alicloud.context.BaseAliCloudSpringApplication;
-import com.alibaba.alicloud.utils.ChangeOrderUtils;
-import com.alibaba.cloud.context.ans.AliCloudAnsInitializer;
-import com.alibaba.cloud.context.edas.EdasChangeOrderConfigurationFactory;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-
-import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
-
-/**
- * @author xiaolongzuo
- */
-@PrepareForTest({ EdasChangeOrderConfigurationFactory.class,
- NacosConfigParameterInitListener.class, AliCloudAnsInitializer.class })
-public class NacosConfigParameterInitListenerTests extends BaseAliCloudSpringApplication {
-
- @BeforeClass
- public static void setUp() {
- ChangeOrderUtils.mockChangeOrder();
- }
-
- @Test
- public void testNacosParameterInitListener() {
- assertThat(System.getProperty("spring.cloud.nacos.config.server-mode"))
- .isEqualTo("EDAS");
- assertThat(System.getProperty("spring.cloud.nacos.config.server-addr"))
- .isEqualTo("");
- assertThat(System.getProperty("spring.cloud.nacos.config.endpoint"))
- .isEqualTo("testDomain");
- assertThat(System.getProperty("spring.cloud.nacos.config.namespace"))
- .isEqualTo("testTenantId");
- assertThat(System.getProperty("spring.cloud.nacos.config.access-key"))
- .isEqualTo("testAK");
- assertThat(System.getProperty("spring.cloud.nacos.config.secret-key"))
- .isEqualTo("testSK");
-
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/nacos/NacosDiscoveryParameterInitListenerTests.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/nacos/NacosDiscoveryParameterInitListenerTests.java
deleted file mode 100644
index 35d1489e..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/nacos/NacosDiscoveryParameterInitListenerTests.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.nacos;
-
-import com.alibaba.alicloud.context.BaseAliCloudSpringApplication;
-import com.alibaba.alicloud.utils.ChangeOrderUtils;
-import com.alibaba.cloud.context.ans.AliCloudAnsInitializer;
-import com.alibaba.cloud.context.edas.EdasChangeOrderConfigurationFactory;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-
-import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
-
-/**
- * @author xiaolongzuo
- */
-@PrepareForTest({ EdasChangeOrderConfigurationFactory.class,
- NacosDiscoveryParameterInitListener.class, AliCloudAnsInitializer.class })
-public class NacosDiscoveryParameterInitListenerTests
- extends BaseAliCloudSpringApplication {
-
- @BeforeClass
- public static void setUp() {
- ChangeOrderUtils.mockChangeOrder();
- }
-
- @Test
- public void testNacosParameterInitListener() {
- assertThat(System.getProperty("spring.cloud.nacos.discovery.server-mode"))
- .isEqualTo("EDAS");
- assertThat(System.getProperty("spring.cloud.nacos.discovery.server-addr"))
- .isEqualTo("");
- assertThat(System.getProperty("spring.cloud.nacos.discovery.endpoint"))
- .isEqualTo("testDomain");
- assertThat(System.getProperty("spring.cloud.nacos.discovery.namespace"))
- .isEqualTo("testTenantId");
- assertThat(System.getProperty("spring.cloud.nacos.discovery.access-key"))
- .isEqualTo("testAK");
- assertThat(System.getProperty("spring.cloud.nacos.discovery.secret-key"))
- .isEqualTo("testSK");
- assertThat(System.getProperties().getProperty("nacos.naming.web.context"))
- .isEqualTo("/vipserver");
- assertThat(System.getProperties().getProperty("nacos.naming.exposed.port"))
- .isEqualTo("80");
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/oss/OssAutoConfigurationTests.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/oss/OssAutoConfigurationTests.java
deleted file mode 100644
index 0772e30e..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/oss/OssAutoConfigurationTests.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.oss;
-
-import com.alibaba.alicloud.context.AliCloudProperties;
-import com.aliyun.oss.OSS;
-import com.aliyun.oss.OSSClient;
-import org.junit.Test;
-
-import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.test.context.runner.ApplicationContextRunner;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * {@link OSS} {@link OssProperties} Test.
- *
- * @author Jim
- */
-public class OssAutoConfigurationTests {
-
- private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
- .withConfiguration(AutoConfigurations.of(OssContextAutoConfiguration.class))
- .withPropertyValues("spring.cloud.alicloud.accessKey=your-ak",
- "spring.cloud.alicloud.secretKey=your-sk",
- "spring.cloud.alicloud.oss.endpoint=http://oss-cn-beijing.aliyuncs.com",
- "spring.cloud.alicloud.oss.config.userAgent=alibaba",
- "spring.cloud.alicloud.oss.sts.access-key=your-sts-ak",
- "spring.cloud.alicloud.oss.sts.secret-key=your-sts-sk",
- "spring.cloud.alicloud.oss.sts.security-token=your-sts-token");
-
- @Test
- public void testOSSProperties() {
- this.contextRunner.run(context -> {
- assertThat(context.getBeansOfType(OssProperties.class).size() == 1).isTrue();
- AliCloudProperties aliCloudProperties = context
- .getBean(AliCloudProperties.class);
- OssProperties ossProperties = context.getBean(OssProperties.class);
- assertThat(aliCloudProperties.getAccessKey()).isEqualTo("your-ak");
- assertThat(aliCloudProperties.getSecretKey()).isEqualTo("your-sk");
- assertThat(ossProperties.getEndpoint())
- .isEqualTo("http://oss-cn-beijing.aliyuncs.com");
- assertThat(ossProperties.getConfig().getUserAgent()).isEqualTo("alibaba");
- assertThat(ossProperties.getSts().getAccessKey()).isEqualTo("your-sts-ak");
- assertThat(ossProperties.getSts().getSecretKey()).isEqualTo("your-sts-sk");
- assertThat(ossProperties.getSts().getSecurityToken())
- .isEqualTo("your-sts-token");
- });
- }
-
- @Test
- public void testOSSClient1() {
- this.contextRunner.run(context -> {
- assertThat(context.getBeansOfType(OSS.class).size() == 1).isTrue();
- assertThat(context.getBeanNamesForType(OSS.class)[0]).isEqualTo("ossClient");
- OSSClient ossClient = (OSSClient) context.getBean(OSS.class);
- assertThat(ossClient.getEndpoint().toString())
- .isEqualTo("http://oss-cn-beijing.aliyuncs.com");
- assertThat(ossClient.getClientConfiguration().getUserAgent())
- .isEqualTo("alibaba");
- assertThat(
- ossClient.getCredentialsProvider().getCredentials().getAccessKeyId())
- .isEqualTo("your-ak");
- assertThat(ossClient.getCredentialsProvider().getCredentials()
- .getSecretAccessKey()).isEqualTo("your-sk");
- });
- }
-
- @Test
- public void testOSSClient2() {
- this.contextRunner
- .withPropertyValues("spring.cloud.alicloud.oss.authorization-mode=STS")
- .run(context -> {
- assertThat(context.getBeansOfType(OSS.class).size() == 1).isTrue();
- assertThat(context.getBeanNamesForType(OSS.class)[0])
- .isEqualTo("ossClient");
- OSSClient ossClient = (OSSClient) context.getBean(OSS.class);
- assertThat(ossClient.getEndpoint().toString())
- .isEqualTo("http://oss-cn-beijing.aliyuncs.com");
- assertThat(ossClient.getClientConfiguration().getUserAgent())
- .isEqualTo("alibaba");
- assertThat(ossClient.getCredentialsProvider().getCredentials()
- .getAccessKeyId()).isEqualTo("your-sts-ak");
- assertThat(ossClient.getCredentialsProvider().getCredentials()
- .getSecretAccessKey()).isEqualTo("your-sts-sk");
- assertThat(ossClient.getCredentialsProvider().getCredentials()
- .getSecurityToken()).isEqualTo("your-sts-token");
- });
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/scx/ScxAutoConfigurationTests.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/scx/ScxAutoConfigurationTests.java
deleted file mode 100644
index ce3f78ac..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/scx/ScxAutoConfigurationTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.scx;
-
-import com.alibaba.alicloud.context.edas.EdasProperties;
-import org.junit.Test;
-
-import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.test.context.runner.ApplicationContextRunner;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * @author xiaolongzuo
- */
-public class ScxAutoConfigurationTests {
-
- private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
- .withConfiguration(AutoConfigurations.of(ScxContextAutoConfiguration.class))
- .withPropertyValues("spring.cloud.alicloud.scx.group-id=1-2-3-4")
- .withPropertyValues("spring.cloud.alicloud.edas.namespace=cn-test");
-
- @Test
- public void testSxcProperties() {
- this.contextRunner.run(context -> {
- assertThat(context.getBeansOfType(ScxProperties.class).size() == 1).isTrue();
- EdasProperties edasProperties = context.getBean(EdasProperties.class);
- ScxProperties scxProperties = context.getBean(ScxProperties.class);
- assertThat(scxProperties.getGroupId()).isEqualTo("1-2-3-4");
- assertThat(edasProperties.getNamespace()).isEqualTo("cn-test");
- assertThat(scxProperties.getDomainName()).isNull();
- });
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/sentinel/SentinelAliCloudListenerTests.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/sentinel/SentinelAliCloudListenerTests.java
deleted file mode 100644
index 389361d6..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/sentinel/SentinelAliCloudListenerTests.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.sentinel;
-
-import com.alibaba.alicloud.context.BaseAliCloudSpringApplication;
-import com.alibaba.alicloud.context.Constants;
-import com.alibaba.alicloud.utils.ChangeOrderUtils;
-import com.alibaba.cloud.context.edas.EdasChangeOrderConfigurationFactory;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-
-import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
-
-/**
- * @author xiaolongzuo
- */
-@PrepareForTest({ EdasChangeOrderConfigurationFactory.class,
- SentinelAliCloudListener.class })
-public class SentinelAliCloudListenerTests extends BaseAliCloudSpringApplication {
-
- @BeforeClass
- public static void setUp() {
- ChangeOrderUtils.mockChangeOrder();
- }
-
- @Test
- public void testNacosParameterInitListener() {
- assertThat(System.getProperty(Constants.Sentinel.NACOS_DATASOURCE_ENDPOINT))
- .isEqualTo("testDomain");
- assertThat(System.getProperty(Constants.Sentinel.PROJECT_NAME))
- .isEqualTo("testProjectName");
- assertThat(System.getProperty(Constants.Sentinel.NACOS_DATASOURCE_NAMESPACE))
- .isEqualTo("testTenantId");
- assertThat(System.getProperty(Constants.Sentinel.NACOS_DATASOURCE_AK))
- .isEqualTo("testAK");
- assertThat(System.getProperty(Constants.Sentinel.NACOS_DATASOURCE_SK))
- .isEqualTo("testSK");
-
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/sms/SmsPropertiesTests.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/sms/SmsPropertiesTests.java
deleted file mode 100644
index b3c674e6..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/context/sms/SmsPropertiesTests.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.context.sms;
-
-import com.alibaba.alicloud.context.AliCloudContextAutoConfiguration;
-import com.alibaba.alicloud.context.edas.EdasContextAutoConfiguration;
-import org.junit.Test;
-
-import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.test.context.runner.ApplicationContextRunner;
-
-import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
-
-/**
- * @author xiaolongzuo
- */
-public class SmsPropertiesTests {
-
- private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
- .withConfiguration(AutoConfigurations.of(SmsContextAutoConfiguration.class,
- EdasContextAutoConfiguration.class,
- AliCloudContextAutoConfiguration.class));
-
- @Test
- public void testConfigurationValueDefaultsAreAsExpected() {
- this.contextRunner.run(context -> {
- SmsProperties config = context.getBean(SmsProperties.class);
- assertThat(config.getReportQueueName()).isNull();
- assertThat(config.getUpQueueName()).isNull();
- assertThat(config.getConnectTimeout()).isEqualTo("10000");
- assertThat(config.getReadTimeout()).isEqualTo("10000");
- });
- }
-
- @Test
- public void testConfigurationValuesAreCorrectlyLoaded() {
- this.contextRunner
- .withPropertyValues("spring.cloud.alicloud.sms.reportQueueName=q1",
- "spring.cloud.alicloud.sms.upQueueName=q2",
- "spring.cloud.alicloud.sms.connect-timeout=20",
- "spring.cloud.alicloud.sms.read-timeout=30")
- .run(context -> {
- SmsProperties config = context.getBean(SmsProperties.class);
- assertThat(config.getReportQueueName()).isEqualTo("q1");
- assertThat(config.getUpQueueName()).isEqualTo("q2");
- assertThat(config.getConnectTimeout()).isEqualTo("20");
- assertThat(config.getReadTimeout()).isEqualTo("30");
- });
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/oss/OssAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/oss/OssAutoConfiguration.java
deleted file mode 100644
index 568d475c..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/oss/OssAutoConfiguration.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.oss;
-
-/**
- * @author xiaolongzuo
- */
-public class OssAutoConfiguration {
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/scx/ScxAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/scx/ScxAutoConfiguration.java
deleted file mode 100644
index 80e81031..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/scx/ScxAutoConfiguration.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.scx;
-
-/**
- * @author xiaolongzuo
- */
-public class ScxAutoConfiguration {
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/utils/ChangeOrderUtils.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/utils/ChangeOrderUtils.java
deleted file mode 100644
index 2c5b0fe5..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/alicloud/utils/ChangeOrderUtils.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.utils;
-
-import com.alibaba.cloud.context.edas.EdasChangeOrderConfiguration;
-import com.alibaba.cloud.context.edas.EdasChangeOrderConfigurationFactory;
-import org.powermock.api.mockito.PowerMockito;
-
-/**
- * @author xiaolongzuo
- */
-public final class ChangeOrderUtils {
-
- private ChangeOrderUtils() {
- }
-
- public static void mockChangeOrder() {
- EdasChangeOrderConfiguration edasChangeOrderConfiguration = PowerMockito
- .mock(EdasChangeOrderConfiguration.class);
- PowerMockito.when(edasChangeOrderConfiguration.isEdasManaged()).thenReturn(true);
- PowerMockito.when(edasChangeOrderConfiguration.getAddressServerDomain())
- .thenReturn("testDomain");
- PowerMockito.when(edasChangeOrderConfiguration.getTenantId())
- .thenReturn("testTenantId");
- PowerMockito.when(edasChangeOrderConfiguration.getDauthAccessKey())
- .thenReturn("testAK");
- PowerMockito.when(edasChangeOrderConfiguration.getDauthSecretKey())
- .thenReturn("testSK");
- PowerMockito.when(edasChangeOrderConfiguration.getProjectName())
- .thenReturn("testProjectName");
- PowerMockito.when(edasChangeOrderConfiguration.getAddressServerPort())
- .thenReturn("8080");
- PowerMockito.mockStatic(EdasChangeOrderConfigurationFactory.class);
- PowerMockito
- .when(EdasChangeOrderConfigurationFactory
- .getEdasChangeOrderConfiguration())
- .thenReturn(edasChangeOrderConfiguration);
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/cloud/nacos/NacosConfigAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/cloud/nacos/NacosConfigAutoConfiguration.java
deleted file mode 100644
index b39d75ec..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/cloud/nacos/NacosConfigAutoConfiguration.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.nacos;
-
-/**
- * @author xiaolongzuo
- */
-public class NacosConfigAutoConfiguration {
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/cloud/nacos/NacosDiscoveryAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/cloud/nacos/NacosDiscoveryAutoConfiguration.java
deleted file mode 100644
index 4b584239..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/cloud/nacos/NacosDiscoveryAutoConfiguration.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.cloud.nacos;
-
-/**
- * @author xiaolongzuo
- */
-public class NacosDiscoveryAutoConfiguration {
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/csp/sentinel/datasource/nacos/NacosDataSource.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/csp/sentinel/datasource/nacos/NacosDataSource.java
deleted file mode 100644
index 3ea26682..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/alibaba/csp/sentinel/datasource/nacos/NacosDataSource.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.csp.sentinel.datasource.nacos;
-
-/**
- * @author xiaolongzuo
- */
-public class NacosDataSource {
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/aliyuncs/dysmsapi/model/v20170525/SendSmsRequest.java b/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/aliyuncs/dysmsapi/model/v20170525/SendSmsRequest.java
deleted file mode 100644
index 5f943018..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-alicloud-context/src/test/java/com/aliyuncs/dysmsapi/model/v20170525/SendSmsRequest.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.aliyuncs.dysmsapi.model.v20170525;
-
-/**
- * @author xiaolongzuo
- */
-public class SendSmsRequest {
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/pom.xml b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/pom.xml
deleted file mode 100644
index 0ba4cd28..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-
- 4.0.0
-
-
- com.alibaba.cloud
- spring-cloud-starter-alicloud
- 2.2.1.BUILD-SNAPSHOT
- ../pom.xml
-
-
- spring-cloud-starter-alicloud-acm
- Spring Cloud Starter Alibaba Cloud ACM
-
-
-
- org.springframework.boot
- spring-boot-starter
-
-
-
- com.alibaba.cloud
- spring-cloud-alicloud-context
-
-
-
- com.aliyun
- aliyun-java-sdk-core
-
-
-
- com.aliyun
- aliyun-java-sdk-edas
-
-
-
- com.alibaba.edas.acm
- acm-sdk
-
-
-
- org.springframework.boot
- spring-boot-autoconfigure
- true
-
-
-
- org.springframework.boot
- spring-boot-starter-actuator
- true
-
-
-
-
- org.springframework.cloud
- spring-cloud-context
-
-
- org.springframework.cloud
- spring-cloud-commons
-
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
- org.powermock
- powermock-module-junit4
- 2.0.0
- test
-
-
- org.powermock
- powermock-api-mockito2
- 2.0.0
- test
-
-
-
-
diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/AcmAutoConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/AcmAutoConfiguration.java
deleted file mode 100644
index ac4065b9..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/AcmAutoConfiguration.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.acm;
-
-import com.alibaba.alicloud.acm.refresh.AcmContextRefresher;
-import com.alibaba.alicloud.acm.refresh.AcmRefreshHistory;
-import com.alibaba.alicloud.context.acm.AcmIntegrationProperties;
-import com.taobao.diamond.client.Diamond;
-
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.cloud.context.refresh.ContextRefresher;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * Created on 01/10/2017.
- *
- * @author juven.xuxb
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnClass({ Diamond.class })
-@ConditionalOnProperty(name = "spring.cloud.alicloud.acm.enabled", matchIfMissing = true)
-public class AcmAutoConfiguration {
-
- @Bean
- public AcmRefreshHistory acmRefreshHistory() {
- return new AcmRefreshHistory();
- }
-
- @Bean
- public AcmContextRefresher acmContextRefresher(
- AcmIntegrationProperties acmIntegrationProperties,
- ContextRefresher contextRefresher, AcmRefreshHistory refreshHistory,
- AcmPropertySourceRepository acmPropertySourceRepository) {
- return new AcmContextRefresher(contextRefresher, acmIntegrationProperties,
- refreshHistory, acmPropertySourceRepository);
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/AcmPropertySourceRepository.java b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/AcmPropertySourceRepository.java
deleted file mode 100644
index 4604ae6c..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/AcmPropertySourceRepository.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.acm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import com.alibaba.alicloud.acm.bootstrap.AcmPropertySource;
-
-import org.springframework.core.env.PropertySource;
-
-/**
- * @author juven.xuxb, 5/17/16.
- * @author yuhuangbin
- */
-public class AcmPropertySourceRepository {
-
- private Map acmPropertySourceMap = new ConcurrentHashMap<>();
-
- /**
- * get all acm properties from AcmPropertySourceRepository.
- * @return list of acm propertysource
- */
- public List allAcmPropertySource() {
- List result = new ArrayList<>();
- result.addAll(this.acmPropertySourceMap.values());
- return result;
- }
-
- public void collectAcmPropertySource(
- Collection> acmPropertySources) {
- acmPropertySources.forEach(propertySource -> {
- if (propertySource.getClass().isAssignableFrom(AcmPropertySource.class)) {
- AcmPropertySource acmPropertySource = (AcmPropertySource) propertySource;
- this.acmPropertySourceMap.put(getMapKey(acmPropertySource.getDataId(),
- acmPropertySource.getGroup()), acmPropertySource);
- }
- });
- }
-
- public String getMapKey(String dataId, String group) {
- return String.join(",", dataId, group);
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/bootstrap/AcmConfigBootStrapConfiguration.java b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/bootstrap/AcmConfigBootStrapConfiguration.java
deleted file mode 100644
index 91bb484a..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/bootstrap/AcmConfigBootStrapConfiguration.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.acm.bootstrap;
-
-import com.alibaba.alicloud.acm.AcmPropertySourceRepository;
-import com.alibaba.alicloud.context.acm.AcmIntegrationProperties;
-import com.taobao.diamond.client.Diamond;
-
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author yuhuangbin
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnClass({ Diamond.class })
-@ConditionalOnProperty(name = "spring.cloud.alicloud.acm.enabled", matchIfMissing = true)
-public class AcmConfigBootStrapConfiguration {
-
- @Bean
- public AcmPropertySourceRepository acmPropertySourceRepository() {
- return new AcmPropertySourceRepository();
- }
-
- @Bean
- public AcmPropertySourceLocator acmPropertySourceLocator(
- AcmPropertySourceRepository acmPropertySourceRepository,
- AcmIntegrationProperties acmIntegrationProperties) {
- return new AcmPropertySourceLocator(acmIntegrationProperties,
- acmPropertySourceRepository);
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/bootstrap/AcmPropertySource.java b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/bootstrap/AcmPropertySource.java
deleted file mode 100644
index 5fc7020a..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/bootstrap/AcmPropertySource.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.acm.bootstrap;
-
-import java.util.Date;
-import java.util.Map;
-
-import org.springframework.core.env.MapPropertySource;
-
-/**
- * @author juven.xuxb
- * @author xiaolongzuo
- */
-public class AcmPropertySource extends MapPropertySource {
-
- private final String dataId;
-
- private final String group;
-
- private final Date timestamp;
-
- private final boolean groupLevel;
-
- AcmPropertySource(String dataId, String group, Map source,
- Date timestamp, boolean groupLevel) {
- super(dataId, source);
- this.dataId = dataId;
- this.group = group;
- this.timestamp = timestamp;
- this.groupLevel = groupLevel;
- }
-
- public String getDataId() {
- return dataId;
- }
-
- public Date getTimestamp() {
- return timestamp;
- }
-
- public String getGroup() {
- return group;
- }
-
- public boolean isGroupLevel() {
- return groupLevel;
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/bootstrap/AcmPropertySourceBuilder.java b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/bootstrap/AcmPropertySourceBuilder.java
deleted file mode 100644
index be5130bb..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/bootstrap/AcmPropertySourceBuilder.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.acm.bootstrap;
-
-import java.io.StringReader;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import com.alibaba.edas.acm.ConfigService;
-import com.alibaba.edas.acm.exception.ConfigException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
-import org.springframework.core.io.ByteArrayResource;
-import org.springframework.util.StringUtils;
-
-/**
- * @author juven.xuxb
- * @author xiaolongzuo
- */
-class AcmPropertySourceBuilder {
-
- private Logger log = LoggerFactory.getLogger(AcmPropertySourceBuilder.class);
-
- /**
- * 传入 ACM 的 DataId 和 groupID,获取到解析后的 AcmProperty 对象.
- * @param dataId dataid of diamond
- * @param diamondGroup group of diamond
- * @param groupLevel group level of diamond
- * @return acm property source
- */
- AcmPropertySource build(String dataId, String diamondGroup, boolean groupLevel) {
- Properties properties = loadDiamondData(dataId, diamondGroup);
- if (properties == null) {
- return null;
- }
- return new AcmPropertySource(dataId, diamondGroup, toMap(properties), new Date(),
- groupLevel);
- }
-
- private Properties loadDiamondData(String dataId, String diamondGroup) {
- try {
- String data = ConfigService.getConfig(dataId, diamondGroup, 3000L);
- if (StringUtils.isEmpty(data)) {
- return null;
- }
- if (dataId.endsWith(".properties")) {
- Properties properties = new Properties();
- log.info(String.format("Loading acm data, dataId: '%s', group: '%s'",
- dataId, diamondGroup));
- properties.load(new StringReader(data));
- return properties;
- }
- else if (dataId.endsWith(".yaml") || dataId.endsWith(".yml")) {
- YamlPropertiesFactoryBean yamlFactory = new YamlPropertiesFactoryBean();
- yamlFactory.setResources(new ByteArrayResource(data.getBytes()));
- return yamlFactory.getObject();
- }
- }
- catch (Exception e) {
- if (e instanceof ConfigException) {
- log.error("DIAMOND-100500:" + dataId + ", " + e.toString(), e);
- }
- else {
- log.error("DIAMOND-100500:" + dataId, e);
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- private Map toMap(Properties properties) {
- Map result = new HashMap<>();
- Enumeration keys = (Enumeration) properties.propertyNames();
- while (keys.hasMoreElements()) {
- String key = keys.nextElement();
- Object value = properties.getProperty(key);
- if (value != null) {
- result.put(key, ((String) value).trim());
- }
- else {
- result.put(key, null);
- }
- }
- return result;
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/bootstrap/AcmPropertySourceLocator.java b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/bootstrap/AcmPropertySourceLocator.java
deleted file mode 100644
index 4c983c80..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/bootstrap/AcmPropertySourceLocator.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.acm.bootstrap;
-
-import com.alibaba.alicloud.acm.AcmPropertySourceRepository;
-import com.alibaba.alicloud.context.acm.AcmIntegrationProperties;
-
-import org.springframework.cloud.bootstrap.config.PropertySourceLocator;
-import org.springframework.core.env.CompositePropertySource;
-import org.springframework.core.env.Environment;
-import org.springframework.core.env.PropertySource;
-
-/**
- * @author juven.xuxb
- * @author xiaolongzuo
- * @author yuhuangbin
- */
-public class AcmPropertySourceLocator implements PropertySourceLocator {
-
- private static final String DIAMOND_PROPERTY_SOURCE_NAME = "diamond";
-
- private AcmPropertySourceBuilder acmPropertySourceBuilder = new AcmPropertySourceBuilder();
-
- private AcmIntegrationProperties acmIntegrationProperties;
-
- private AcmPropertySourceRepository acmPropertySourceRepository;
-
- public AcmPropertySourceLocator(AcmIntegrationProperties acmIntegrationProperties,
- AcmPropertySourceRepository acmPropertySourceRepository) {
- this.acmIntegrationProperties = acmIntegrationProperties;
- this.acmPropertySourceRepository = acmPropertySourceRepository;
- }
-
- @Override
- public PropertySource> locate(Environment environment) {
-
- CompositePropertySource compositePropertySource = new CompositePropertySource(
- DIAMOND_PROPERTY_SOURCE_NAME);
-
- acmIntegrationProperties.setActiveProfiles(environment.getActiveProfiles());
-
- for (String dataId : acmIntegrationProperties.getGroupConfigurationDataIds()) {
- loadDiamondDataIfPresent(compositePropertySource, dataId,
- acmIntegrationProperties.getAcmProperties().getGroup(), true);
- }
-
- for (String dataId : acmIntegrationProperties
- .getApplicationConfigurationDataIds()) {
- loadDiamondDataIfPresent(compositePropertySource, dataId,
- acmIntegrationProperties.getAcmProperties().getGroup(), false);
- }
- acmPropertySourceRepository
- .collectAcmPropertySource(compositePropertySource.getPropertySources());
- return compositePropertySource;
- }
-
- private void loadDiamondDataIfPresent(final CompositePropertySource composite,
- final String dataId, final String diamondGroup, final boolean groupLevel) {
- AcmPropertySource ps = acmPropertySourceBuilder.build(dataId, diamondGroup,
- groupLevel);
- if (ps != null) {
- composite.addFirstPropertySource(ps);
- }
- }
-
-}
diff --git a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/endpoint/AcmEndpoint.java b/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/endpoint/AcmEndpoint.java
deleted file mode 100644
index 6a84b844..00000000
--- a/spring-cloud-starter-alicloud/spring-cloud-starter-alicloud-acm/src/main/java/com/alibaba/alicloud/acm/endpoint/AcmEndpoint.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2013-2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.alicloud.acm.endpoint;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.alibaba.alicloud.acm.AcmPropertySourceRepository;
-import com.alibaba.alicloud.acm.bootstrap.AcmPropertySource;
-import com.alibaba.alicloud.acm.refresh.AcmRefreshHistory;
-import com.alibaba.alicloud.context.acm.AcmProperties;
-
-import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
-import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
-
-/**
- * Created on 01/10/2017.
- *
- * @author juven.xuxb
- */
-@Endpoint(id = "acm")
-public class AcmEndpoint {
-
- private final AcmProperties properties;
-
- private final AcmRefreshHistory refreshHistory;
-
- private final AcmPropertySourceRepository acmPropertySourceRepository;
-
- private ThreadLocal dateFormat = new ThreadLocal() {
- @Override
- protected DateFormat initialValue() {
- return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- }
- };
-
- public AcmEndpoint(AcmProperties properties, AcmRefreshHistory refreshHistory,
- AcmPropertySourceRepository acmPropertySourceRepository) {
- this.properties = properties;
- this.refreshHistory = refreshHistory;
- this.acmPropertySourceRepository = acmPropertySourceRepository;
- }
-
- @ReadOperation
- public Map invoke() {
- Map result = new HashMap<>();
- result.put("config", properties);
-
- Map runtime = new HashMap<>();
- List all = acmPropertySourceRepository.allAcmPropertySource();
-
- List