public abstract class PrivilegeManager extends Object implements IPrivilegeManager<Privilege>
Modifier and Type | Field and Description |
---|---|
static Debug |
debug
Debug for Policy Administration Point classes
|
static Subject |
superAdminSubject |
Constructor and Description |
---|
PrivilegeManager(ApplicationServiceFactory applicationServiceFactory,
ResourceTypeService resourceTypeService,
ConstraintValidator validator)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Privilege privilege)
Add a privilege.
|
boolean |
canFindByName(String name)
Checks if a privilege with the specified name can be found.
|
abstract List<Privilege> |
findAllPolicies()
Finds all policies within the realm.
|
abstract List<Privilege> |
findAllPoliciesByApplication(String application)
Finds all policies within the realm and passed application.
|
abstract List<Privilege> |
findAllPoliciesByIdentityUid(String uid)
Finds all policies based on the identity uid, whether user or group uid.
|
abstract Privilege |
findByName(String name,
Subject subject)
Returns a privilege.
|
protected Subject |
getAdminSubject() |
static PrivilegeManager |
getInstance(String realm,
Subject subject)
Returns instance of configured
PrivilegeManager |
String |
getRealm()
Returns realm name.
|
void |
initialize(String realm,
Subject subject)
Initializes the object.
|
static boolean |
isNameValid(String target) |
abstract void |
modify(String existingName,
Privilege privilege)
Modifies the specified policy.
|
protected abstract void |
notifyPrivilegeChanged(String realm,
Privilege previous,
Privilege current,
PolicyEventType eventType) |
List<Privilege> |
search(Set<SearchFilter> filter)
Returns a set of privileges that match the given search criteria with no size or time limits.
|
List<Privilege> |
search(Set<SearchFilter> filter,
int searchSizeLimit,
int searchTimeLimit)
Returns a set of privileges that match the given search criteria.
|
Set<String> |
searchNames(Set<SearchFilter> filter)
Returns a set of privilege names for a given search criteria.
|
Set<String> |
searchNames(Set<SearchFilter> filter,
int searchSizeLimit,
int searchTimeLimit)
Returns a set of privilege names for a given search criteria.
|
protected void |
validate(Privilege privilege)
Validates the passed policy.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findByName, modify, remove
public static final Debug debug
public static final Subject superAdminSubject
public PrivilegeManager(ApplicationServiceFactory applicationServiceFactory, ResourceTypeService resourceTypeService, ConstraintValidator validator)
public static PrivilegeManager getInstance(String realm, Subject subject)
PrivilegeManager
subject
- subject that would be used for the privilege management operationsPrivilegeManager
public void initialize(String realm, Subject subject)
realm
- Realm namesubject
- subject to initilialize the privilege manager withpublic abstract Privilege findByName(String name, Subject subject) throws EntitlementException
name
- name for the privilege to be returnedsubject
- Subject to be used to obtain the privilege.EntitlementException
- if privilege is not found or if the provided subject is not permitted to access it.public boolean canFindByName(String name) throws EntitlementException
canFindByName
in interface IPrivilegeManager<Privilege>
name
- name of the privilege.EntitlementException
- if search failed.protected void validate(Privilege privilege) throws EntitlementException
privilege
- the policy instanceEntitlementException
- should validator failpublic void add(Privilege privilege) throws EntitlementException
add
in interface IPrivilegeManager<Privilege>
privilege
- privilege to add.EntitlementException
- if privilege cannot be added.public abstract void modify(String existingName, Privilege privilege) throws EntitlementException
existingName
- The existing policy nameprivilege
- The new policy contentEntitlementException
- When an error occurs during modificationpublic Set<String> searchNames(Set<SearchFilter> filter, int searchSizeLimit, int searchTimeLimit) throws EntitlementException
searchNames
in interface IPrivilegeManager<Privilege>
filter
- Set of search filter.searchSizeLimit
- Search size limit.searchTimeLimit
- Search time limit in seconds.EntitlementException
- if search failed.public List<Privilege> search(Set<SearchFilter> filter, int searchSizeLimit, int searchTimeLimit) throws EntitlementException
filter
- the search filters to apply. An empty set means no filtering (returns all privileges).searchSizeLimit
- the maximum number of privileges to return.searchTimeLimit
- the maximum time limit in seconds. NOT IMPLEMENTED.EntitlementException
- if the search fails for any reason.public List<Privilege> search(Set<SearchFilter> filter) throws EntitlementException
filter
- the search filters to apply. An empty set means no filtering (returns all privileges).EntitlementException
- if the search fails for any reason.public Set<String> searchNames(Set<SearchFilter> filter) throws EntitlementException
searchNames
in interface IPrivilegeManager<Privilege>
filter
- Set of search filter.EntitlementException
- if search failed.public abstract List<Privilege> findAllPolicies() throws EntitlementException
EntitlementException
- should some error occurpublic abstract List<Privilege> findAllPoliciesByApplication(String application) throws EntitlementException
application
- the applicationEntitlementException
- should some error occurpublic abstract List<Privilege> findAllPoliciesByIdentityUid(String uid) throws EntitlementException
uid
- identity uidEntitlementException
- should some query error occurpublic String getRealm()
protected Subject getAdminSubject()
protected abstract void notifyPrivilegeChanged(String realm, Privilege previous, Privilege current, PolicyEventType eventType) throws EntitlementException
EntitlementException
public static boolean isNameValid(String target)
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.