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 ofPrivilegeManager
that saves privileges ascom.sun.identity.policy
objects
-
-
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 void
add(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.Privilege
findByName(String name)
Finds a privilege by its unique name.Privilege
findByName(String privilegeName, Subject adminSubject)
Returns a privilege.void
initialize(String realm, Subject subject)
Initializes the objectvoid
modify(Privilege privilege)
Modify a privilege.void
modify(String existingName, Privilege privilege)
Modify a privilege.protected void
notifyPrivilegeChanged(String realm, Privilege previous, Privilege current, PolicyEventType eventType)
void
remove(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:
initialize
in 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:PrivilegeManager
Returns a privilege.- Specified by:
findByName
in 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:PrivilegeManager
Finds all policies within the realm.- Specified by:
findAllPolicies
in 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:PrivilegeManager
Finds all policies within the realm and passed application.- Specified by:
findAllPoliciesByApplication
in 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:PrivilegeManager
Finds all policies based on the identity uid, whether user or group uid.- Specified by:
findAllPoliciesByIdentityUid
in 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:
add
in interfaceIPrivilegeManager<Privilege>
- Overrides:
add
in 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:
modify
in 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:
notifyPrivilegeChanged
in classPrivilegeManager
- Throws:
EntitlementException
-
-