class DataCache {

    void processRoleMembers(String roleName, List<RoleMember> members) {
        
        // early out
        
        if (members == null) {
            return;
        }
        
        // memberRoleCache: add members

        long currentTime = System.currentTimeMillis();
        for (RoleMember member : members) {
            
            // if the role member is disabled then we'll skip it

            if (AuthzHelper.isMemberDisabled(member.getSystemDisabled())) {
                continue;
            }

            // if the role member is already expired then there
            // is no point to add it to the cache

            long expiration = member.getExpiration() == null ? 0 : member.getExpiration().millis();
            if (expiration != 0 && expiration < currentTime) {
                continue;
            }
            
            // we're going to process 3 types of members
            // * - all members have access to these roles
            // <prefix>* - members with the key name prefix
            // <member> - regular members
            
            final String memberName = member.getMemberName();
            if (memberName.equals("*")) {
                memberAllRoleCache.add(new MemberRole(roleName, expiration));
            } else if (memberName.endsWith("*")) {
                final String keyName = memberName.substring(0, memberName.length() - 1);
                if (!memberPrefixRoleCache.containsKey(keyName)) {
                    memberPrefixRoleCache.put(keyName, new HashSet<>());
                }
                final Set<MemberRole> rolesForMember = memberPrefixRoleCache.get(keyName);
                rolesForMember.add(new MemberRole(roleName, expiration));
            } else {
                if (!memberRoleCache.containsKey(memberName)) {
                    memberRoleCache.put(memberName, new HashSet<>());
                }
                final Set<MemberRole> rolesForMember = memberRoleCache.get(memberName);
                rolesForMember.add(new MemberRole(roleName, expiration));
            }
        }
    }

    public  DataCache();

}