/*
 * Copyright 2016-2018 shardingsphere.io.
 * <p>
 * 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
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * </p>
 */

package io.shardingsphere.jdbc.orchestration.internal.yaml.converter;

import io.shardingsphere.jdbc.orchestration.internal.OrchestrationProxyConfiguration;
import io.shardingsphere.jdbc.orchestration.internal.yaml.representer.DefaultConfigurationRepresenter;
import io.shardingsphere.jdbc.orchestration.internal.yaml.representer.ProxyConfigurationRepresenter;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.yaml.snakeyaml.Yaml;

/**
 * Proxy Config converter.
 *
 * @author panjuan
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ProxyConfigurationConverter {
    
    private static final Yaml YAML = new Yaml(new DefaultConfigurationRepresenter());
    
    /**
     * Convert yaml proxy configuration to yaml string.
     *
     * @param orchestrationProxyConfiguration Yaml proxy configuration
     * @return Yaml string
     */
    public static String proxyConfigToYaml(final OrchestrationProxyConfiguration orchestrationProxyConfiguration) {
        Yaml yaml = new Yaml(new ProxyConfigurationRepresenter());
        return yaml.dumpAsMap(orchestrationProxyConfiguration);
    }
    
    /**
     * Convert yaml to data source map.
     *
     * @param yamlProxyConfigYamlString String in yaml
     * @return Yaml proxy configuration
     */
    public static OrchestrationProxyConfiguration proxyConfigFromYaml(final String yamlProxyConfigYamlString) {
        return YAML.loadAs(yamlProxyConfigYamlString, OrchestrationProxyConfiguration.class);
    }
}

@@ -713,67 +713,40 @@
 ere.
-jdbc
+core
 .orche
-stration.internal.OrchestrationProxyConfiguration
+.config.ProxyBasicRule
 ;%0Aim
@@ -1380,39 +1380,22 @@
 ram 
-orchestrationProxyConfiguration
+proxyBasicRule
  Yam
@@ -1504,71 +1504,37 @@
 nal 
-OrchestrationProxyConfiguration orchestrationProxyConfiguration
+ProxyBasicRule proxyBasicRule
 ) %7B%0A
@@ -1634,39 +1634,22 @@
 Map(
-orchestrationProxyConfiguration
+proxyBasicRule
 );%0A 
@@ -1693,23 +1693,28 @@
  to 
-data source map
+proxy configuration 
 .%0A  
@@ -1843,39 +1843,22 @@
 tic 
-OrchestrationProxyConfiguration
+ProxyBasicRule
  pro
@@ -1974,39 +1974,22 @@
 ng, 
-OrchestrationProxyConfiguration
+ProxyBasicRule
 .cla

Convert yaml to proxy basic rule