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

package org.apache.shardingsphere.shardingproxy.backend.schema;

import lombok.Getter;
import org.apache.shardingsphere.core.metadata.ShardingMetaData;
import org.apache.shardingsphere.core.rule.EncryptRule;
import org.apache.shardingsphere.core.rule.ShardingRule;

/**
 * Encrypt schema.
 *
 * @author panjuan
 */
@Getter
public final class EncryptSchema extends LogicSchema {
    
    private final EncryptRule encryptRule;
    
    private final ShardingMetaData metaData;
    
    private final ShardingRule defaultShardingRule;
}

@@ -920,30 +920,352 @@
 ere.
-core.metadata.Sharding
+api.config.encryptor.EncryptRuleConfiguration;%0Aimport org.apache.shardingsphere.api.config.sharding.ShardingRuleConfiguration;%0Aimport org.apache.shardingsphere.core.metadata.ShardingMetaData;%0Aimport org.apache.shardingsphere.core.metadata.datasource.ShardingDataSourceMetaData;%0Aimport org.apache.shardingsphere.core.metadata.table.ShardingTable
 Meta
@@ -1382,16 +1382,123 @@
 ingRule;
+%0Aimport org.apache.shardingsphere.shardingproxy.config.yaml.YamlDataSourceParameter;%0A%0Aimport java.util.Map;
 %0A%0A/**%0A *
@@ -1702,24 +1702,24 @@
 aData;%0A    %0A
-
     private 
@@ -1758,10 +1758,951 @@
 ngRule;%0A
+    %0A    public EncryptSchema(final String name, final Map%3CString, YamlDataSourceParameter%3E dataSources, final EncryptRuleConfiguration encryptRuleConfiguration) %7B%0A        super(name, dataSources);%0A        encryptRule = new EncryptRule(encryptRuleConfiguration);%0A        defaultShardingRule = new ShardingRule(new ShardingRuleConfiguration(), getDataSources().keySet());%0A        metaData = createShardingMetaData();%0A    %7D%0A    %0A    private ShardingMetaData createShardingMetaData() %7B%0A        ShardingDataSourceMetaData shardingDataSourceMetaData = new ShardingDataSourceMetaData(getDataSourceURLs(getDataSources()), defaultShardingRule, LogicSchemas.getInstance().getDatabaseType());%0A        ShardingTableMetaData shardingTableMetaData = new ShardingTableMetaData(getTableMetaDataInitializer(shardingDataSourceMetaData).load(defaultShardingRule));%0A        return new ShardingMetaData(shardingDataSourceMetaData, shardingTableMetaData);%0A    %7D%0A
 %7D%0A

add constructor for encrypt schema