Class PolicyPrivilegeManager
- java.lang.Object
-
- com.sun.identity.entitlement.PrivilegeManager
-
- com.sun.identity.entitlement.opensso.PolicyPrivilegeManager
-
- All Implemented Interfaces:
IPrivilegeManager<Privilege>
public class PolicyPrivilegeManager extends PrivilegeManager
Implementation ofPrivilegeManagerthat saves privileges ascom.sun.identity.policyobjects
-
-
Field Summary
-
Fields inherited from class com.sun.identity.entitlement.PrivilegeManager
debug, superAdminSubject
-
-
Constructor Summary
Constructors Constructor Description PolicyPrivilegeManager(ApplicationServiceFactory applicationServiceFactory, ResourceTypeService resourceTypeService, ConstraintValidator constraintValidator, NotificationBroker broker, NotificationsConfig notificationsConfig)Creates instance ofPolicyPrivilegeManager
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Privilege privilege)Add a privilege.List<Privilege>findAllPolicies()Finds all policies within the realm.List<Privilege>findAllPoliciesByApplication(String application)Finds all policies within the realm and passed application.List<Privilege>findAllPoliciesByIdentityUid(String uid)Finds all policies based on the identity uid, whether user or group uid.PrivilegefindByName(String name)Finds a privilege by its unique name.PrivilegefindByName(String privilegeName, Subject adminSubject)Returns a privilege.voidinitialize(String realm, Subject subject)Initializes the objectvoidmodify(Privilege privilege)Modify a privilege.voidmodify(String existingName, Privilege privilege)Modify a privilege.protected voidnotifyPrivilegeChanged(String realm, Privilege previous, Privilege current, PolicyEventType eventType)voidremove(String name)Remove a privilege.-
Methods inherited from class com.sun.identity.entitlement.PrivilegeManager
canFindByName, getAdminSubject, getInstance, getRealm, isNameValid, search, search, searchNames, searchNames, validate
-
-
-
-
Constructor Detail
-
PolicyPrivilegeManager
@Inject public PolicyPrivilegeManager(ApplicationServiceFactory applicationServiceFactory, ResourceTypeService resourceTypeService, ConstraintValidator constraintValidator, NotificationBroker broker, NotificationsConfig notificationsConfig)
Creates instance ofPolicyPrivilegeManager
-
-
Method Detail
-
initialize
public void initialize(String realm, Subject subject)
Initializes the object- Overrides:
initializein classPrivilegeManager- Parameters:
subject- subject that would be used for privilege management operationsrealm- Realm name
-
findByName
public Privilege findByName(String name) throws EntitlementException
Finds a privilege by its unique name.- Parameters:
name- name of the privilege to be returned- Throws:
EntitlementException- if privilege is not found.
-
findByName
public Privilege findByName(String privilegeName, Subject adminSubject) throws EntitlementException
Description copied from class:PrivilegeManagerReturns a privilege.- Specified by:
findByNamein classPrivilegeManager- Parameters:
privilegeName- name for the privilege to be returnedadminSubject- Subject to be used to obtain the privilege.- Throws:
EntitlementException- if privilege is not found or if the provided subject is not permitted to access it.
-
findAllPolicies
public List<Privilege> findAllPolicies() throws EntitlementException
Description copied from class:PrivilegeManagerFinds all policies within the realm.- Specified by:
findAllPoliciesin classPrivilegeManager- Returns:
- list of matching policies
- Throws:
EntitlementException- should some error occur
-
findAllPoliciesByApplication
public List<Privilege> findAllPoliciesByApplication(String application) throws EntitlementException
Description copied from class:PrivilegeManagerFinds all policies within the realm and passed application.- Specified by:
findAllPoliciesByApplicationin classPrivilegeManager- 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:PrivilegeManagerFinds all policies based on the identity uid, whether user or group uid.- Specified by:
findAllPoliciesByIdentityUidin classPrivilegeManager- Parameters:
uid- identity uid- Returns:
- list of matching policies else an empty list
- Throws:
EntitlementException- should some query error occur
-
add
public void add(Privilege privilege) throws EntitlementException
Add a privilege.- Specified by:
addin interfaceIPrivilegeManager<Privilege>- Overrides:
addin classPrivilegeManager- Parameters:
privilege- privilege to add.- Throws:
EntitlementException- if privilege cannot be added.
-
remove
public void remove(String name) throws EntitlementException
Remove a privilege.- Parameters:
name- name of the privilege to be removed.- Throws:
EntitlementException- if privilege cannot be removed.
-
modify
public void modify(String existingName, Privilege privilege) throws EntitlementException
Modify a privilege.- Specified by:
modifyin classPrivilegeManager- Parameters:
existingName- the name with which the privilege is currently storedprivilege- the privilege to be modified- Throws:
EntitlementException- if privilege cannot be modified.
-
modify
public void modify(Privilege privilege) throws EntitlementException
Modify a privilege.- Parameters:
privilege- the privilege to be modified- Throws:
EntitlementException- if privilege cannot be modified.
-
notifyPrivilegeChanged
protected void notifyPrivilegeChanged(String realm, Privilege previous, Privilege current, PolicyEventType eventType) throws EntitlementException
- Specified by:
notifyPrivilegeChangedin classPrivilegeManager- Throws:
EntitlementException
-
-