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 Detail

      • getAvailableCidrGroups

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

        java.util.Set<java.lang.String> getCidrsOfCidrGroupAsStrings​(java.lang.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​(java.lang.String cidrGroupName,
                             java.util.List<java.lang.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​(java.lang.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​(java.util.Map<java.lang.String,​java.util.List<java.lang.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

        java.util.Set<java.lang.String> getCidrGroupsOfIP​(java.lang.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