public class DelegationPolicyImpl extends Object implements DelegationInterface, ServiceListener, IdEventListener, PolicyListener
DelegationPolicyImpl
implements the interface
DelegationInterface
using OpenAM Policy
Management and Evaluation APIs. It provides access control for access
manager using the OpenAM's internal policy framework.ADDED, MODIFIED, REMOVED
Constructor and Description |
---|
DelegationPolicyImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addPrivilege(SSOToken token,
String orgName,
DelegationPrivilege privilege)
Adds a delegation privilege to a specific realm.
|
void |
allIdentitiesChanged()
The method is called when all identities in the repository are
changed.
|
Set |
getManageableOrganizationNames(SSOToken token,
Set organizationNames)
Returns a set of realm names, based on the input parameter
organizationNames , in which the "user" has some
delegation permissions. |
Set |
getPermissions(SSOToken token,
String orgName)
Returns a set of permissions that a user has.
|
Set |
getPrivileges(SSOToken token,
String orgName)
Returns all the delegation privileges associated with a realm.
|
String |
getServiceTypeName()
Gets the service type name for which this listener wants to get
notifications
|
Set |
getSubjects(SSOToken token,
String orgName,
Set types,
String pattern)
Returns a set of selected subjects of specified types matching the
pattern in the given realm.
|
void |
globalConfigChanged(String serviceName,
String version,
String groupName,
String serviceComponent,
int type)
This method will be invoked when a service's global configuration
data has been changed.
|
void |
identityChanged(String universalId)
This method is called back for all identities that are
modified in a repository.
|
void |
identityDeleted(String universalId)
This method is called back for all identities that are
deleted from a repository.
|
void |
identityRenamed(String universalId)
This method is called for all identities that are
renamed in a repository.
|
void |
initialize(SSOToken token,
Map configParams)
Initialize (or configure) the
DelegationInterface
object. |
boolean |
isAllowed(SSOToken token,
DelegationPermission permission,
Map envParams)
Returns a boolean value; if a user has the specified
permission returns true, false otherwise.
|
void |
organizationConfigChanged(String serviceName,
String version,
String orgName,
String groupName,
String serviceComponent,
int type)
This method will be invoked when a service's organization
configuration data has been changed.
|
void |
policyChanged(PolicyEvent policyEvent)
This method is called by the policy framework whenever
a policy is added, removed or changed.
|
void |
removePrivilege(SSOToken token,
String orgName,
String privilegeName)
Removes a delegation privilege from a specific realm.
|
void |
schemaChanged(String serviceName,
String version)
This method will be invoked when a service's schema has been changed.
|
public void initialize(SSOToken token, Map configParams) throws DelegationException
DelegationInterface
object. Usually it will be initialized with the environmrnt
parameters set by the system administrator via Service management service.initialize
in interface DelegationInterface
token
- SSOToken
of an administratorconfigParams
- configuration parameters as a Map
.
The values in the Map
is java.util.Set
,
which contains one or more configuration parameters.DelegationException
- if an error occurred during
initialization of DelegationInterface
instancepublic Set getPrivileges(SSOToken token, String orgName) throws SSOException, DelegationException
getPrivileges
in interface DelegationInterface
token
- The SSOToken
of the requesting userorgName
- The name of the realm from which the
delegation privileges are fetched.Set
of DelegationPrivilege
objects
associated with the realm.SSOException
- invalid or expired single-sign-on tokenDelegationException
- for any abnormal conditionpublic void addPrivilege(SSOToken token, String orgName, DelegationPrivilege privilege) throws SSOException, DelegationException
addPrivilege
in interface DelegationInterface
token
- The SSOToken
of the requesting userorgName
- The name of the realm to which the delegation privilege
is to be added.privilege
- The delegation privilege to be added.SSOException
- invalid or expired single-sign-on tokenDelegationException
- if any abnormal condition occurred.public void removePrivilege(SSOToken token, String orgName, String privilegeName) throws SSOException, DelegationException
removePrivilege
in interface DelegationInterface
token
- The SSOToken
of the requesting userorgName
- The name of the realm from which the delegation
privilege is to be removed.privilegeName
- The name of the delegation privilege to be removed.SSOException
- invalid or expired single-sign-on tokenDelegationException
- for any abnormal conditionpublic Set getSubjects(SSOToken token, String orgName, Set types, String pattern) throws SSOException, DelegationException
getSubjects
in interface DelegationInterface
token
- The SSOToken
of the requesting userorgName
- The name of the realm from which the subjects are fetched.types
- a set of subject types. e.g. ROLE, GROUP.pattern
- a filter used to select the subjects.SSOException
- invalid or expired single-sign-on tokenDelegationException
- for any abnormal conditionSSOException
- invalid or expired single-sign-on tokenDelegationException
- for any abnormal conditionpublic Set getManageableOrganizationNames(SSOToken token, Set organizationNames) throws SSOException, DelegationException
organizationNames
, in which the "user" has some
delegation permissions.getManageableOrganizationNames
in interface DelegationInterface
token
- The SSOToken
of the requesting userorganizationNames
- a Set
of realm names.Set
of realm names in which the user has some
delegation permissions. It is a subset of
organizationNames
SSOException
- invalid or expired single-sign-on tokenDelegationException
- for any abnormal conditionpublic boolean isAllowed(SSOToken token, DelegationPermission permission, Map envParams) throws SSOException, DelegationException
isAllowed
in interface DelegationInterface
token
- Single sign on token of the user evaluating permission.permission
- Delegation permission to be evaluatedenvParams
- Run-time environment parameters.SSOException
- single-sign-on token invalid or expired.DelegationException
- for any other abnormal condition.public Set getPermissions(SSOToken token, String orgName) throws SSOException, DelegationException
getPermissions
in interface DelegationInterface
token
- sso token of the user requesting permissionsorgName
- The name of the realm from which the delegation
permissions are fetched.Set
of permissions that a user hasSSOException
- if single-sign-on token invalid or expiredDelegationException
- for any other abnormal conditionpublic void schemaChanged(String serviceName, String version)
schemaChanged
in interface ServiceListener
serviceName
- name of the serviceversion
- version of the servicepublic void globalConfigChanged(String serviceName, String version, String groupName, String serviceComponent, int type)
groupName
denote
the name of the configuration grouping (e.g. default) and
serviceComponent
denotes the service's sub-component
that changed (e.g. /NamedPolicy
, /Templates
).globalConfigChanged
in interface ServiceListener
serviceName
- name of the service.version
- version of the service.groupName
- name of the configuration grouping.serviceComponent
- name of the service components that
changed.type
- change type, i.e., ADDED, REMOVED or MODIFIED.public void organizationConfigChanged(String serviceName, String version, String orgName, String groupName, String serviceComponent, int type)
organizationConfigChanged
in interface ServiceListener
serviceName
- name of the serviceversion
- version of the serviceorgName
- organization name as DNgroupName
- name of the configuration groupingserviceComponent
- the name of the service components that
changedtype
- change type, i.e., ADDED, REMOVED or MODIFIEDpublic void identityChanged(String universalId)
identityChanged
in interface IdEventListener
universalId
- Universal Identifier of the identity.public void identityDeleted(String universalId)
identityDeleted
in interface IdEventListener
universalId
- Univerval Identifierpublic void identityRenamed(String universalId)
identityRenamed
in interface IdEventListener
universalId
- Universal Identifierpublic void allIdentitiesChanged()
allIdentitiesChanged
in interface IdEventListener
public String getServiceTypeName()
getServiceTypeName
in interface PolicyListener
public void policyChanged(PolicyEvent policyEvent)
serviceTypeName
of this listenerpolicyChanged
in interface PolicyListener
policyEvent
- event object sent by the policy frameworkPolicyEvent
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.