class DataStore implements DataCacheProvider, RolesProvider {

    void addRoleToList(String role, String rolePrefix, String[] requestedRoleList,
            Set<String> accessibleRoles, boolean keepFullName) {

        /* any roles we return must start with the domain role prefix */

        if (!role.startsWith(rolePrefix)) {
            return;
        }

        /* and it must end with the suffix if requested */
        
        if (requestedRoleList != null) {
            boolean matchFound = false;
            for (String requestedRole : requestedRoleList) {
                if (role.endsWith(requestedRole)) {
                    matchFound = true;
                    break;
                }
            }
            if (!matchFound) {
                return;
            }
        }

        /* when returning the value we're going to skip the prefix */

        if (keepFullName) {
            accessibleRoles.add(role);
        } else {
            accessibleRoles.add(role.substring(rolePrefix.length()));
        }
    }

    public  DataStore(ChangeLogStore clogStore, CloudStore cloudStore);

}