class DataStore implements DataCacheProvider, RolesProvider {

    public void getAccessibleRoles(DataCache data, String domainName, String identity,
            String[] requestedRoleList, Set<String> accessibleRoles, boolean keepFullName) {

        /* if the domain hasn't been processed then we don't have anything to do */
        
        if (data == null) {
            return;
        }
        
        final String rolePrefix = domainName + ROLE_POSTFIX;

        /* first look through the members to see if the given identity is
         * included in the list explicitly */

        processStandardMembership(data.getMemberRoleSet(identity),
                rolePrefix, requestedRoleList, accessibleRoles, keepFullName);
        
        /* next look at all * wildcard roles that are configured
         * for all members to access */

        processStandardMembership(data.getAllMemberRoleSet(),
                rolePrefix, requestedRoleList, accessibleRoles, keepFullName);
        
        /* then look at the prefix wildcard roles. in this map
         * we only process those where the key in the map is
         * a prefix of our identity */
        
        Map<String, Set<MemberRole>> roleSetMap = data.getPrefixMemberRoleSetMap();
        for (String identityPrefix : roleSetMap.keySet()) {
            if (identity.startsWith(identityPrefix)) {
                processStandardMembership(roleSetMap.get(identityPrefix),
                        rolePrefix, requestedRoleList, accessibleRoles, keepFullName);
            }
        }

        // now process our group membership

        processGroupMembership(data, identity, rolePrefix, requestedRoleList, accessibleRoles, keepFullName);

        /* finally process all the roles that have trusted domain specified */

        processTrustMembership(data, identity, rolePrefix, requestedRoleList,
                accessibleRoles, keepFullName);
    }

    public  DataStore(ChangeLogStore clogStore, CloudStore cloudStore);

}