package com.twjitm.rpc.zookeeper;

import com.twjitm.TestSpring;
import com.twjitm.core.bootstrap.Bootstrap;
import com.twjitm.core.common.zookeeper.NettyZookeeperNodeInfo;
import com.twjitm.core.common.zookeeper.NettyZookeeperNodeNettyGameTypeEnum;
import com.twjitm.core.common.zookeeper.NettyZookeeperRpcServiceDiscoveryService;
import com.twjitm.core.common.zookeeper.NettyZookeeperRpcServiceRegistryService;
import com.twjitm.core.spring.SpringServiceManager;

import java.util.List;

/**
 * @author twjitm - [Created on 2018-08-23 11:48]
 * @company https://github.com/twjitm/
 * @jdk java version "1.8.0_77"
 */
public class NettyZookeeperTest {
    private static NettyZookeeperRpcServiceRegistryService registryService;
    private static NettyZookeeperRpcServiceDiscoveryService discoveryService;

    public static void main(String[] args) {
        TestSpring.initSpring();
        Bootstrap.startServer();
        registryService = SpringServiceManager.getSpringLoadService().getNettyZookeeperRpcServiceRegistryService();
        discoveryService = SpringServiceManager.getSpringLoadService().getNettyZookeeperRpcServiceDiscoveryService();
       test();

    }

    private static void test() {
        List<NettyZookeeperNodeInfo> list = discoveryService.getNodeList(NettyZookeeperNodeNettyGameTypeEnum.WORLD);
        System.out.println(list);
    }
}
