Interface CIDRGroupsMappingManagerMBean

All Known Implementing Classes:
CIDRGroupsMappingManager

public interface CIDRGroupsMappingManagerMBean
This class provides utility functions to list/update/drop CIDR groups mappings. nodetool commands invoke these functions, hence need to register mbean even when CIDR authorization is disabled
  • Method Details

    • getAvailableCidrGroups

      Set<String> getAvailableCidrGroups()
      Retrieves available CIDR groups in the table AuthKeyspace.CIDR_GROUPS
      Returns:
      returns CIDR groups set
    • getCidrsOfCidrGroupAsStrings

      Set<String> getCidrsOfCidrGroupAsStrings(String cidrGroupName)
      Retrieves all CIDRs associated with a given CIDR group in the table AuthKeyspace.CIDR_GROUPS, including invalid CIDRs (if exists)
      Parameters:
      cidrGroupName - CIDR group to retrieve associated CIDRs
      Returns:
      returns set of CIDRs as strings
    • updateCidrGroup

      void updateCidrGroup(String cidrGroupName, List<String> cidrs)
      Insert/Update CIDR group to CIDRs mapping in the table AuthKeyspace.CIDR_GROUPS
      Parameters:
      cidrGroupName - CIDR group name
      cidrs - List of CIDRs as strings
    • dropCidrGroup

      void dropCidrGroup(String cidrGroupName)
      Delete a CIDR group and associated mapping from the table AuthKeyspace.CIDR_GROUPS throws exception if input cidr group name doesn't exist in the table before deletion
      Parameters:
      cidrGroupName - CIDR group name
    • recreateCidrGroupsMapping

      void recreateCidrGroupsMapping(Map<String,List<String>> cidrGroupsMapping)
      Update AuthKeyspace.CIDR_GROUPS table with completly new mappings. Insert nonexisting CIDR groups, update existing CIDR groups with given set of CIDRs and delete nolonger valid CIDR groups.
      Parameters:
      cidrGroupsMapping - CIDR group mappings
    • getCidrGroupsOfIP

      Set<String> getCidrGroupsOfIP(String ipStr)
      Get CIDR groups of a given IP, when CIDR authorizer is enabled. Throws exception if CIDR authorizer is disabled
      Parameters:
      ipStr - IP as a string
      Returns:
      Set of strings
    • loadCidrGroupsCache

      void loadCidrGroupsCache()
      Trigger reload of CIDR groups cache