Search in sources :

Example 16 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project java-chassis by ServiceComb.

the class TestKieCenterDefaultDeploymentProvider method testConfigurationEnv.

@Test
public void testConfigurationEnv() {
    System.setProperty("servicecomb.kie.serverUri", "https://localhost:30110");
    KieCenterDefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(KieCenterDefaultDeploymentProvider.SYSTEM_KEY_KIE_CENTER);
    Assert.assertEquals(info.getAccessURL().get(0), "https://localhost:30110");
    System.getProperties().remove("servicecomb.kie.serverUri");
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo) Test(org.junit.Test)

Example 17 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project java-chassis by ServiceComb.

the class TestKieCenterDefaultDeploymentProvider method testConfigurationEnvTwo.

@Test
public void testConfigurationEnvTwo() {
    System.setProperty("servicecomb.kie.serverUri", "http://127.0.0.1:30110,http://127.0.0.2:30110");
    KieCenterDefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(KieCenterDefaultDeploymentProvider.SYSTEM_KEY_KIE_CENTER);
    Assert.assertEquals(info.getAccessURL().size(), 2);
    Assert.assertEquals(info.getAccessURL().get(0), "http://127.0.0.1:30110");
    Assert.assertEquals(info.getAccessURL().get(1), "http://127.0.0.2:30110");
    System.getProperties().remove("servicecomb.kie.serverUri");
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo) Test(org.junit.Test)

Example 18 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project java-chassis by ServiceComb.

the class ConfigCenterConfigurationSourceImpl method isValidSource.

@Override
public boolean isValidSource(Configuration localConfiguration) {
    ConfigCenterConfig.setConcurrentCompositeConfiguration((ConcurrentCompositeConfiguration) localConfiguration);
    SystemBootstrapInfo address = Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER);
    if (address == null) {
        LOGGER.info("config center server is not configured.");
        return false;
    }
    return true;
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo)

Example 19 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project java-chassis by ServiceComb.

the class ConfigCenterDefaultDeploymentProvider method getSystemBootStrapInfo.

@Override
public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
    if (!systemKey.equals(SYSTEM_KEY_CONFIG_CENTER)) {
        return null;
    }
    List<String> ccAddresses = ConfigUtil.parseArrayValue(configuration.getString("servicecomb.config.client.serverUri"));
    if (ccAddresses.isEmpty()) {
        return null;
    }
    SystemBootstrapInfo cc = new SystemBootstrapInfo();
    cc.setAccessURL(ccAddresses);
    return cc;
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo)

Example 20 with SystemBootstrapInfo

use of org.apache.servicecomb.deployment.SystemBootstrapInfo in project java-chassis by ServiceComb.

the class MonitorDefaultDeploymentProvider method getSystemBootStrapInfo.

@Override
public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
    if (!systemKey.equals(MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE)) {
        return null;
    }
    List<String> msAddresses = ConfigUtil.parseArrayValue(configuration.getString(MonitorConstant.MONITOR_URI));
    if (msAddresses.isEmpty()) {
        return null;
    }
    SystemBootstrapInfo ms = new SystemBootstrapInfo();
    ms.setAccessURL(msAddresses);
    return ms;
}
Also used : SystemBootstrapInfo(org.apache.servicecomb.deployment.SystemBootstrapInfo)

Aggregations

SystemBootstrapInfo (org.apache.servicecomb.deployment.SystemBootstrapInfo)30 Test (org.junit.Test)18 ArrayList (java.util.ArrayList)2