Class OpenSSOIndexStore
- java.lang.Object
-
- com.sun.identity.entitlement.PrivilegeIndexStore
-
- com.sun.identity.entitlement.opensso.OpenSSOIndexStore
-
public class OpenSSOIndexStore extends PrivilegeIndexStore
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classOpenSSOIndexStore.SearchTask
-
Constructor Summary
Constructors Constructor Description OpenSSOIndexStore(Subject adminSubject, String realm)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Set<IPrivilege> privileges)Adds a set of privileges to the data store.voiddelete(String privilegeName)Deletes a set of privileges from data store.Stringdelete(String privilegeName, boolean notify)Deletes a privilege from data store.voiddelete(Set<IPrivilege> privileges)Deletes a privilege from data store.voiddeleteReferral(String privilegeName)Deletes a referral privilege from data store.StringdeleteReferral(String privilegeName, boolean notify)Deletes a referralprivilege from data store.List<Privilege>findAllPolicies()Finds all policies within the passed realm.List<Privilege>findAllPoliciesByApplication(String application)Finds all policies within the passed realm and application.List<Privilege>findAllPoliciesByIdentityUid(String uid)Finds all policies based on the identity uid, whether user or group uid.static intgetNumCachedPolicies()static intgetNumCachedPolicies(String realm)static intgetNumCachedReferrals()static intgetNumCachedReferrals(String realm)IPrivilegegetPrivilege(String privilegeName)Retrieve an individual privilege from the data store.Set<String>getReferredResources(String applicationTypeName)Returns a set of resources that are referred to this realm.booleanhasPrivilgesWithApplication(String realm, String applName)static booleanisOrgAliasMappingResourceEnabled(SSOToken adminToken)Iterator<IPrivilege>search(String realm, ResourceSearchIndexes indexes, Set<String> subjectIndexes, boolean bSubTree)Returns an iterator of matching privilege objects.Iterator<IPrivilege>search(String realm, ResourceSearchIndexes indexes, Set<String> subjectIndexes, boolean bSubTree, boolean bReferral)Search for policies.Set<String>searchPrivilegeNames(Set<SearchFilter> filters, boolean boolAnd, int numOfEntries, boolean sortResults, boolean ascendingOrder)Returns a set of privilege names that satifies a search filter.Set<String>searchReferralPrivilegeNames(Set<SearchFilter> filters, boolean boolAnd, int numOfEntries, boolean sortResults, boolean ascendingOrder)Returns a set of referral privilege names that satifies a search filter.Set<String>searchReferralPrivilegeNames(Set<SearchFilter> filters, Subject adminSubject, String currentRealm, boolean boolAnd, int numOfEntries, boolean sortResults, boolean ascendingOrder)Returns a set of referral privilege names that matched a set of search criteria.-
Methods inherited from class com.sun.identity.entitlement.PrivilegeIndexStore
getAdminSubject, getInstance, getRealm
-
-
-
-
Method Detail
-
add
public void add(Set<IPrivilege> privileges) throws EntitlementException
Adds a set of privileges to the data store. Proper indexes will be created to speed up policy evaluation.- Specified by:
addin classPrivilegeIndexStore- Parameters:
privileges- Privileges to be added.- Throws:
EntitlementException- if addition failed.
-
delete
public void delete(String privilegeName) throws EntitlementException
Deletes a set of privileges from data store.- Specified by:
deletein classPrivilegeIndexStore- Parameters:
privilegeName- Name of privilege to be deleted.- Throws:
EntitlementException- if deletion failed.
-
deleteReferral
public void deleteReferral(String privilegeName) throws EntitlementException
Deletes a referral privilege from data store.- Specified by:
deleteReferralin classPrivilegeIndexStore- Parameters:
privilegeName- Name of referral to be deleted.- Throws:
EntitlementException- if deletion failed.
-
delete
public void delete(Set<IPrivilege> privileges) throws EntitlementException
Deletes a privilege from data store.- Specified by:
deletein classPrivilegeIndexStore- Parameters:
privileges- Privileges to be deleted.- Throws:
EntitlementException- if deletion failed.
-
delete
public String delete(String privilegeName, boolean notify) throws EntitlementException
Description copied from class:PrivilegeIndexStoreDeletes a privilege from data store.- Specified by:
deletein classPrivilegeIndexStore- Parameters:
privilegeName- name of privilege to be deleted.notify-trueto notify changes.- Throws:
EntitlementException- if deletion failed.
-
deleteReferral
public String deleteReferral(String privilegeName, boolean notify) throws EntitlementException
Description copied from class:PrivilegeIndexStoreDeletes a referralprivilege from data store.- Specified by:
deleteReferralin classPrivilegeIndexStore- Parameters:
privilegeName- name of privilege to be deleted.notify-trueto notify changes.- Throws:
EntitlementException- if deletion failed.
-
search
public Iterator<IPrivilege> search(String realm, ResourceSearchIndexes indexes, Set<String> subjectIndexes, boolean bSubTree) throws EntitlementException
Returns an iterator of matching privilege objects.- Specified by:
searchin classPrivilegeIndexStore- Parameters:
realm- Realm Name.indexes- Resource search indexes.subjectIndexes- Subject search indexes.bSubTree-truefor sub tree evaluation.- Returns:
- an iterator of matching privilege objects.
- Throws:
EntitlementException- if results cannot be obtained.
-
search
public Iterator<IPrivilege> search(String realm, ResourceSearchIndexes indexes, Set<String> subjectIndexes, boolean bSubTree, boolean bReferral) throws EntitlementException
Search for policies.- Parameters:
realm- The realm of which the policy resides.indexes- Policy indexes.subjectIndexes- Subject indexes.bSubTree- Whether in subtree mode.bReferral- Whether there is a policy referral.- Returns:
- An iterator of policies.
- Throws:
EntitlementException- Should an error occur searching for policies.
-
getPrivilege
public IPrivilege getPrivilege(String privilegeName)
Retrieve an individual privilege from the data store.- Specified by:
getPrivilegein classPrivilegeIndexStore- Parameters:
privilegeName- Name of the privilege to return.- Returns:
- The privilege, or empty if none was found.
-
searchPrivilegeNames
public Set<String> searchPrivilegeNames(Set<SearchFilter> filters, boolean boolAnd, int numOfEntries, boolean sortResults, boolean ascendingOrder) throws EntitlementException
Returns a set of privilege names that satifies a search filter.- Specified by:
searchPrivilegeNamesin classPrivilegeIndexStore- Parameters:
filters- Search filters.boolAnd-trueto have filters as exclusive.numOfEntries- Number of max entries.sortResults-trueto have result sorted.ascendingOrder-trueto have result sorted in ascending order.- Returns:
- a set of privilege names that satifies a search filter.
- Throws:
EntitlementException- if search failed.
-
searchReferralPrivilegeNames
public Set<String> searchReferralPrivilegeNames(Set<SearchFilter> filters, boolean boolAnd, int numOfEntries, boolean sortResults, boolean ascendingOrder) throws EntitlementException
Returns a set of referral privilege names that satifies a search filter.- Specified by:
searchReferralPrivilegeNamesin classPrivilegeIndexStore- Parameters:
filters- Search filters.boolAnd-trueto have filters as exclusive.numOfEntries- Number of max entries.sortResults-trueto have result sorted.ascendingOrder-trueto have result sorted in ascending order.- Returns:
- a set of referral privilege names that satifies a search filter.
- Throws:
EntitlementException- if search failed.
-
searchReferralPrivilegeNames
public Set<String> searchReferralPrivilegeNames(Set<SearchFilter> filters, Subject adminSubject, String currentRealm, boolean boolAnd, int numOfEntries, boolean sortResults, boolean ascendingOrder) throws EntitlementException
Returns a set of referral privilege names that matched a set of search criteria.- Parameters:
filters- Set of search filter (criteria).boolAnd-trueto be inclusive.numOfEntries- Number of maximum search entries.sortResults-trueto have the result sorted.ascendingOrder-trueto have the result sorted in ascending order.- Returns:
- a set of referral privilege names that matched a set of search criteria.
- Throws:
EntitlementException- if search failed.
-
getReferredResources
public Set<String> getReferredResources(String applicationTypeName) throws EntitlementException
Returns a set of resources that are referred to this realm.- Specified by:
getReferredResourcesin classPrivilegeIndexStore- Parameters:
applicationTypeName- Application type name,- Returns:
- a set of resources that are referred to this realm.
- Throws:
EntitlementException- if resources cannot be returned.
-
findAllPolicies
public List<Privilege> findAllPolicies() throws EntitlementException
Description copied from class:PrivilegeIndexStoreFinds all policies within the passed realm.- Specified by:
findAllPoliciesin classPrivilegeIndexStore- Returns:
- list of matching policies
- Throws:
EntitlementException- should some error occur
-
findAllPoliciesByApplication
public List<Privilege> findAllPoliciesByApplication(String application) throws EntitlementException
Description copied from class:PrivilegeIndexStoreFinds all policies within the passed realm and application.- Specified by:
findAllPoliciesByApplicationin classPrivilegeIndexStore- Parameters:
application- the application- Returns:
- list of matching policies
- Throws:
EntitlementException- should some error occur
-
findAllPoliciesByIdentityUid
public List<Privilege> findAllPoliciesByIdentityUid(String uid) throws EntitlementException
Description copied from class:PrivilegeIndexStoreFinds all policies based on the identity uid, whether user or group uid.- Specified by:
findAllPoliciesByIdentityUidin classPrivilegeIndexStore- Parameters:
uid- identity uid- Returns:
- list of matching policies else an empty list
- Throws:
EntitlementException- should some query error occur
-
isOrgAliasMappingResourceEnabled
public static boolean isOrgAliasMappingResourceEnabled(SSOToken adminToken)
-
getNumCachedPolicies
public static int getNumCachedPolicies(String realm)
-
getNumCachedReferrals
public static int getNumCachedReferrals(String realm)
-
getNumCachedPolicies
public static int getNumCachedPolicies()
-
getNumCachedReferrals
public static int getNumCachedReferrals()
-
hasPrivilgesWithApplication
public boolean hasPrivilgesWithApplication(String realm, String applName) throws EntitlementException
- Specified by:
hasPrivilgesWithApplicationin classPrivilegeIndexStore- Throws:
EntitlementException
-
-