Search in sources :

Example 16 with IPrivilege

use of com.sun.identity.entitlement.IPrivilege in project OpenAM by OpenRock.

the class DataStore method search.

/**
     * Returns a set of privilege that satifies the resource and subject
     * indexes.
     *
     * @param adminSubject Subject who has the rights to read datastore.
     * @param realm Realm name
     * @param iterator Buffered iterator to have the result fed to it.
     * @param indexes Resource search indexes.
     * @param subjectIndexes Subject search indexes.
     * @param bSubTree <code>true</code> to do sub tree search
     * @param excludeDNs Set of DN to be excluded from the search results.
     * @return a set of privilege that satifies the resource and subject
     * indexes.
     */
public Set<IPrivilege> search(Subject adminSubject, String realm, BufferedIterator iterator, ResourceSearchIndexes indexes, Set<String> subjectIndexes, boolean bSubTree, Set<String> excludeDNs) throws EntitlementException {
    SSOToken token = getSSOToken(adminSubject);
    Set<IPrivilege> results = searchPrivileges(realm, iterator, indexes, subjectIndexes, bSubTree, excludeDNs);
    // Get referrals only if count is greater than 0
    int countInt = getNumberOfReferrals(realm);
    if (countInt > 0) {
        results.addAll(searchReferral(token, realm, iterator, indexes, bSubTree, excludeDNs));
    }
    return results;
}
Also used : SSOToken(com.iplanet.sso.SSOToken) IPrivilege(com.sun.identity.entitlement.IPrivilege)

Aggregations

IPrivilege (com.sun.identity.entitlement.IPrivilege)16 HashSet (java.util.HashSet)10 EntitlementException (com.sun.identity.entitlement.EntitlementException)9 Privilege (com.sun.identity.entitlement.Privilege)9 SSOToken (com.iplanet.sso.SSOToken)7 ReferralPrivilege (com.sun.identity.entitlement.ReferralPrivilege)7 SSOException (com.iplanet.sso.SSOException)6 SMSException (com.sun.identity.sm.SMSException)6 PrivilegeIndexStore (com.sun.identity.entitlement.PrivilegeIndexStore)5 PolicyException (com.sun.identity.policy.PolicyException)5 Set (java.util.Set)5 ApplicationPrivilege (com.sun.identity.entitlement.ApplicationPrivilege)4 ApplicationPrivilegeManager (com.sun.identity.entitlement.ApplicationPrivilegeManager)4 HashMap (java.util.HashMap)4 EntitlementSubject (com.sun.identity.entitlement.EntitlementSubject)3 ResourceSearchIndexes (com.sun.identity.entitlement.ResourceSearchIndexes)3 Policy (com.sun.identity.policy.Policy)3 SMSEntry (com.sun.identity.sm.SMSEntry)3 Test (org.testng.annotations.Test)3 EntitlementCondition (com.sun.identity.entitlement.EntitlementCondition)2