/** * Adds a rule that restricts access according to the {@link Role} of the * current authenticated {@link User}. Each role is defined a limit in terms * of concurrent requests, in any other case the access is forbidden. * * @param limitsPerRole * The limit assigned per role's name. */ public void addRolesConcurrencyCounter(Map<String, Integer> limitsPerRole) { addRolesConcurrencyCounter(limitsPerRole, 0); }
/** * Adds a rule that restricts access according to the {@link Role} of the * current authenticated {@link User}. Each role is defined a limit in terms * of requests by period of time, in any other case the access is forbidden. * * @param period * The period of time. * @param periodUnit * Period time unit associated to the rule. * @param limitsPerRole * The limit assigned per role's name. */ public void addRolesPeriodicCounter(int period, TimeUnit periodUnit, Map<String, Integer> limitsPerRole) { addRolesPeriodicCounter(period, periodUnit, limitsPerRole, 0); }
/** * Adds a rule that forbids access to the given set of IP addresses. * * @param blackList * The list of rejected IP addresses. */ public void addIpAddressesBlackList(List<String> blackList) { add(new FirewallIpFilteringRule(blackList, false)); }
private void addIpFilterRules(FirewallSettings firewallSettings, FirewallConfig firewallConfig) { if (firewallSettings.getIpFilters() != null) { for (FirewallIpFilter ipFilter : firewallSettings.getIpFilters()) { if (ipFilter.isWhiteList()) { firewallConfig.addIpAddressesWhiteList(ipFilter.getIps()); } else { firewallConfig.addIpAddressesBlackList(ipFilter.getIps()); } } } }
private Integer getRequiredIntegerProperty(Properties properties, String key) { String value = getRequiredProperty(properties, key); try { return Integer.valueOf(value); } catch (NumberFormatException e) { throw new IllegalArgumentException( "Restlet Cloud configuration file error. The property '" + key + "' should be a number", e); } }
private void addIpFilterRules(FirewallSettings firewallSettings, FirewallConfig firewallConfig) { if (firewallSettings.getIpFilters() != null) { for (FirewallIpFilter ipFilter : firewallSettings.getIpFilters()) { if (ipFilter.isWhiteList()) { firewallConfig.addIpAddressesWhiteList(ipFilter.getIps()); } else { firewallConfig.addIpAddressesBlackList(ipFilter.getIps()); } } } }
/** * Adds a rule that forbids access to the given set of IP addresses. * * @param blackList * The list of rejected IP addresses. */ public void addIpAddressesBlackList(List<String> blackList) { add(new FirewallIpFilteringRule(blackList, false)); }
/** * Adds a rule that restricts access according to the {@link Role} of the * current authenticated {@link User}. Each role is defined a limit in terms * of concurrent requests, in any other case the access is forbidden. * * @param limitsPerRole * The limit assigned per role's name. */ public void addRolesConcurrencyCounter(Map<String, Integer> limitsPerRole) { addRolesConcurrencyCounter(limitsPerRole, 0); }
/** * Adds a rule that restricts access according to the {@link Role} of the * current authenticated {@link User}. Each role is defined a limit in terms * of requests by period of time, in any other case the access is forbidden. * * @param period * The period of time. * @param periodUnit * Period time unit associated to the rule. * @param limitsPerRole * The limit assigned per role's name. */ public void addRolesPeriodicCounter(int period, TimeUnit periodUnit, Map<String, Integer> limitsPerRole) { addRolesPeriodicCounter(period, periodUnit, limitsPerRole, 0); }
private Integer getRequiredIntegerProperty(Properties properties, String key) { String value = getRequiredProperty(properties, key); try { return Integer.valueOf(value); } catch (NumberFormatException e) { throw new IllegalArgumentException( "Restlet Cloud configuration file error. The property '" + key + "' should be a number", e); } }
/** * Adds a rule that restricts access to the given set of IP addresses. * * @param whiteList * The list of accepted IP addresses. */ public void addIpAddressesWhiteList(List<String> whiteList) { add(new FirewallIpFilteringRule(whiteList, true)); }
/** * Adds a rule that restricts access according to the {@link Role} of the * current authenticated {@link User}. Each role is defined a limit in terms * of concurrent requests, in any other case the access is forbidden. * * @param limitsPerRole * The limit assigned per role's name. */ public void addRolesConcurrencyCounter(Map<String, Integer> limitsPerRole) { addRolesConcurrencyCounter(limitsPerRole, 0); }
/** * Adds a rule that restricts access according to the {@link Role} of the * current authenticated {@link User}. Each role is defined a limit in terms * of requests by period of time, in any other case the access is forbidden. * * @param period * The period of time. * @param periodUnit * Period time unit associated to the rule. * @param limitsPerRole * The limit assigned per role's name. */ public void addRolesPeriodicCounter(int period, TimeUnit periodUnit, Map<String, Integer> limitsPerRole) { addRolesPeriodicCounter(period, periodUnit, limitsPerRole, 0); }
/** * Adds a rule that restricts access to the given set of IP addresses. * * @param whiteList * The list of accepted IP addresses. */ public void addIpAddressesWhiteList(List<String> whiteList) { add(new FirewallIpFilteringRule(whiteList, true)); }
/** * Adds a rule that restricts access according to the {@link Role} of the * current authenticated {@link User}. Each role is defined a limit in terms * of concurrent requests, in any other case the access is forbidden. * * @param limitsPerRole * The limit assigned per role's name. */ public void addRolesConcurrencyCounter(Map<String, Integer> limitsPerRole) { addRolesConcurrencyCounter(limitsPerRole, 0); }
/** * Adds a rule that restricts access according to the {@link Role} of the * current authenticated {@link User}. Each role is defined a limit in terms * of requests by period of time, in any other case the access is forbidden. * * @param period * The period of time. * @param periodUnit * Period time unit associated to the rule. * @param limitsPerRole * The limit assigned per role's name. */ public void addRolesPeriodicCounter(int period, TimeUnit periodUnit, Map<String, Integer> limitsPerRole) { addRolesPeriodicCounter(period, periodUnit, limitsPerRole, 0); }
/** * Adds a rule that forbids access to the given set of IP addresses. * * @param blackList * The list of rejected IP addresses. */ public void addIpAddressesBlackList(List<String> blackList) { add(new FirewallIpFilteringRule(blackList, false)); }
/** * Adds a rule that forbids access to the given set of IP addresses. * * @param blackList * The list of rejected IP addresses. */ public void addIpAddressesBlackList(List<String> blackList) { add(new FirewallIpFilteringRule(blackList, false)); }
/** * Adds a rule that restricts access to the given set of IP addresses. * * @param whiteList * The list of accepted IP addresses. */ public void addIpAddressesWhiteList(List<String> whiteList) { add(new FirewallIpFilteringRule(whiteList, true)); }
/** * Adds a rule that restricts access to the given set of IP addresses. * * @param whiteList * The list of accepted IP addresses. */ public void addIpAddressesWhiteList(List<String> whiteList) { add(new FirewallIpFilteringRule(whiteList, true)); }