class DataStore implements DataCacheProvider, RolesProvider {

    boolean roleMatchInSet(String role, Set<MemberRole> memberRoles) {

        String rolePattern;
        long currentTime = System.currentTimeMillis();
        for (MemberRole memberRole : memberRoles) {
            
            // before processing make sure the member hasn't
            // expired for this role
            
            long expiration = memberRole.getExpiration();
            if (expiration != 0 && expiration < currentTime) {
                continue;
            }
            
            // if the role does not contain any of our pattern
            // characters then we can just a regular compare
            
            final String roleName = memberRole.getRole();
            if (StringUtils.containsMatchCharacter(roleName)) {
                rolePattern = StringUtils.patternFromGlob(roleName);
                if (role.matches(rolePattern)) {
                    return true;
                }
            } else {
                if (role.equals(roleName)) {
                    return true;
                }
            }
        }
        
        return false;
    }

    public  DataStore(ChangeLogStore clogStore, CloudStore cloudStore);

}