Java Code Examples for com.alibaba.csp.sentinel.slots.block.authority.AuthorityRule#setResource()

The following examples show how to use com.alibaba.csp.sentinel.slots.block.authority.AuthorityRule#setResource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AuthorityDemo.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 5 votes vote down vote up
private static void initWhiteRules() {
    AuthorityRule rule = new AuthorityRule();
    rule.setResource(RESOURCE_NAME);
    rule.setStrategy(RuleConstant.AUTHORITY_WHITE);
    rule.setLimitApp("appA,appE");
    AuthorityRuleManager.loadRules(Collections.singletonList(rule));
}
 
Example 2
Source File: AuthorityDemo.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 5 votes vote down vote up
private static void initBlackRules() {
    AuthorityRule rule = new AuthorityRule();
    rule.setResource(RESOURCE_NAME);
    rule.setStrategy(RuleConstant.AUTHORITY_BLACK);
    rule.setLimitApp("appA,appB");
    AuthorityRuleManager.loadRules(Collections.singletonList(rule));
}
 
Example 3
Source File: AuthorityDemo.java    From Sentinel with Apache License 2.0 5 votes vote down vote up
private static void initWhiteRules() {
    AuthorityRule rule = new AuthorityRule();
    rule.setResource(RESOURCE_NAME);
    rule.setStrategy(RuleConstant.AUTHORITY_WHITE);
    rule.setLimitApp("appA,appE");
    AuthorityRuleManager.loadRules(Collections.singletonList(rule));
}
 
Example 4
Source File: AuthorityDemo.java    From Sentinel with Apache License 2.0 5 votes vote down vote up
private static void initBlackRules() {
    AuthorityRule rule = new AuthorityRule();
    rule.setResource(RESOURCE_NAME);
    rule.setStrategy(RuleConstant.AUTHORITY_BLACK);
    rule.setLimitApp("appA,appB");
    AuthorityRuleManager.loadRules(Collections.singletonList(rule));
}