/*
 * 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.orchestration.internal.registry.config.listener;

import io.shardingsphere.orchestration.internal.registry.config.event.AuthenticationChangedEvent;
import io.shardingsphere.orchestration.internal.registry.config.node.ConfigurationNode;
import io.shardingsphere.orchestration.internal.registry.config.service.ConfigurationService;
import io.shardingsphere.orchestration.internal.registry.listener.PostShardingOrchestrationEventListener;
import io.shardingsphere.orchestration.reg.api.RegistryCenter;
import io.shardingsphere.orchestration.reg.listener.DataChangedEvent;

/**
 * Authentication changed listener.
 *
 * @author panjuan
 */
public final class AuthenticationChangedListener extends PostShardingOrchestrationEventListener {
    
    private final ConfigurationService configService;
    
    public AuthenticationChangedListener(final String name, final RegistryCenter regCenter) {
        super(regCenter, new ConfigurationNode(name).getAuthenticationPath());
        configService = new ConfigurationService(name, regCenter);
    }
    
    @Override
    protected AuthenticationChangedEvent createShardingOrchestrationEvent(final DataChangedEvent event) {
        return new AuthenticationChangedEvent(configService.loadAuthentication());
    }
}

@@ -879,102 +879,8 @@
 de;%0A
-import io.shardingsphere.orchestration.internal.registry.config.service.ConfigurationService;%0A
 impo
@@ -977,24 +977,24 @@
 ntListener;%0A
+
 import io.sh
@@ -1113,16 +1113,88 @@
 edEvent;
+%0Aimport io.shardingsphere.orchestration.yaml.ConfigurationYamlConverter;
 %0A%0A/**%0A *
@@ -1360,67 +1360,8 @@
    %0A
-    private final ConfigurationService configService;%0A    %0A
     
@@ -1533,75 +1533,8 @@
 ));%0A
-        configService = new ConfigurationService(name, regCenter);%0A
     
@@ -1710,21 +1710,34 @@
 ent(
-c
+C
 onfig
-Service
+urationYamlConverter
 .loa
@@ -1752,16 +1752,32 @@
 ication(
+event.getValue()
 ));%0A    

modify createShardingOrchestrationEvent()