com.nepxion.discovery.plugin.framework.adapter.NacosAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of discovery-plugin-framework-nacos Show documentation
Show all versions of discovery-plugin-framework-nacos Show documentation
Nepxion Discovery is an enhancement for Spring Cloud Discovery
package com.nepxion.discovery.plugin.framework.adapter;
/**
* Title: Nepxion Discovery
* Description: Nepxion Discovery
* Copyright: Copyright (c) 2017-2050
* Company: Nepxion
* @author Haojun Ren
* @version 1.0
*/
import java.util.Map;
import com.alibaba.cloud.nacos.ribbon.NacosServer;
import com.netflix.loadbalancer.Server;
public class NacosAdapter extends AbstractPluginAdapter {
@Override
public Map getServerMetadata(Server server) {
if (server instanceof NacosServer) {
NacosServer nacosServer = (NacosServer) server;
return nacosServer.getMetadata();
}
return emptyMetadata;
// throw new DiscoveryException("Server instance isn't the type of NacosServer");
}
}