All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nepxion.discovery.plugin.strategy.rule.DiscoveryEnabledBasePredicate Maven / Gradle / Ivy

There is a newer version: 6.22.0
Show newest version
package com.nepxion.discovery.plugin.strategy.rule;

/**
 * 

Title: Nepxion Discovery

*

Description: Nepxion Discovery

*

Copyright: Copyright (c) 2017-2050

*

Company: Nepxion

* @author Haojun Ren * @version 1.0 */ import com.nepxion.discovery.plugin.framework.adapter.PluginAdapter; import com.nepxion.discovery.plugin.strategy.adapter.DiscoveryEnabledAdapter; import com.netflix.loadbalancer.AbstractServerPredicate; import com.netflix.loadbalancer.PredicateKey; import com.netflix.loadbalancer.Server; public class DiscoveryEnabledBasePredicate extends AbstractServerPredicate { protected PluginAdapter pluginAdapter; protected DiscoveryEnabledAdapter discoveryEnabledAdapter; @Override public boolean apply(PredicateKey input) { return input != null && apply(input.getServer()); } protected boolean apply(Server server) { if (discoveryEnabledAdapter == null) { return true; } return discoveryEnabledAdapter.apply(server); } public void setPluginAdapter(PluginAdapter pluginAdapter) { this.pluginAdapter = pluginAdapter; } public void setDiscoveryEnabledAdapter(DiscoveryEnabledAdapter discoveryEnabledAdapter) { this.discoveryEnabledAdapter = discoveryEnabledAdapter; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy