public final class ClusterFlowRuleManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static Function<String,SentinelProperty<List<FlowRule>>> |
DEFAULT_PROPERTY_SUPPLIER
The default cluster flow rule property supplier that creates a new dynamic property
for a specific namespace to do rule management manually.
|
| Modifier and Type | Method and Description |
|---|---|
static List<FlowRule> |
getAllFlowRules() |
static int |
getConnectedCount(long flowId)
Get connected count for associated namespace of given
flowId. |
static Set<Long> |
getFlowIdSet(String namespace) |
static FlowRule |
getFlowRuleById(Long id)
Get flow rule by rule ID.
|
static List<FlowRule> |
getFlowRules(String namespace)
Get all cluster flow rules within a specific namespace.
|
static String |
getNamespace(long flowId) |
static void |
loadRules(String namespace,
List<FlowRule> rules)
Load flow rules for a specific namespace.
|
static void |
register2Property(String namespace)
Listen to the
SentinelProperty for cluster FlowRules. |
static void |
registerPropertyIfAbsent(String namespace)
Listen to the
SentinelProperty for cluster FlowRules if current property for namespace is absent. |
static void |
removeProperty(String namespace)
Remove cluster flow rule property for a specific namespace.
|
static void |
setPropertySupplier(Function<String,SentinelProperty<List<FlowRule>>> propertySupplier) |
public static final Function<String,SentinelProperty<List<FlowRule>>> DEFAULT_PROPERTY_SUPPLIER
public static void setPropertySupplier(Function<String,SentinelProperty<List<FlowRule>>> propertySupplier)
public static void register2Property(String namespace)
SentinelProperty for cluster FlowRules.
The property is the source of cluster FlowRules for a specific namespace.namespace - namespace to registerpublic static void registerPropertyIfAbsent(String namespace)
SentinelProperty for cluster FlowRules if current property for namespace is absent.
The property is the source of cluster FlowRules for a specific namespace.namespace - namespace to registerpublic static void removeProperty(String namespace)
namespace - valid namespacepublic static FlowRule getFlowRuleById(Long id)
id - rule IDpublic static List<FlowRule> getFlowRules(String namespace)
namespace - valid namespacepublic static void loadRules(String namespace, List<FlowRule> rules)
namespace - a valid namespacerules - rule listpublic static int getConnectedCount(long flowId)
flowId.flowId - unique flow IDpublic static String getNamespace(long flowId)
Copyright © 2020 Alibaba Group. All rights reserved.