|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.identity.policy.PolicyManager
The PolicyManager
class manages policies
for a specific organization, sub organization or a container.
This class is the
starting point for policy management, and provides methods to
create/modify/delete policies.
It is a final class
and hence cannot be further extended. The methods in this class
works directly with the backend datastore (usually a
directory server) to store and manage policies. Hence, user
of this class must have valid SSOToken
and privileges to the backend datastore.
Field Summary | |
static java.lang.String |
ORGANIZATION_NAME
The key for the plugins to get the organization name. |
static java.lang.String |
POLICY_SERVICE_NAME
The service name for Policy component. |
Constructor Summary | |
PolicyManager(SSOToken token)
Constructor for PolicyManager for the
top (or root) organization. |
|
PolicyManager(SSOToken token,
java.lang.String name)
Constructor for PolicyManager for the
specified organization, sub organization or a container object. |
Method Summary | |
void |
addPolicy(Policy policy)
Adds a policy to the data store. |
ConditionTypeManager |
getConditionTypeManager()
Gets the ConditionTypeManager object instance associated
with this PolicyManager object instance |
java.lang.String |
getOrganizationName()
Gets the organization name for which the policy manager was initialized with. |
Policy |
getPolicy(java.lang.String policyName)
Gets the policy object given the name of the policy. |
java.util.Set |
getPolicyNames()
Gets a set of names of polices defined in the organization for which the policy manager was instantiated. |
java.util.Set |
getPolicyNames(java.lang.String pattern)
Gets a set of selected policy names matching the pattern in the given organization. |
ReferralTypeManager |
getReferralTypeManager()
Returns ReferralTypeManager associated with this
policy manager. |
ResourceManager |
getResourceManager()
Gets the ResourceManager object instance associated
with this PolicyManager object instance |
SubjectTypeManager |
getSubjectTypeManager()
Gets the SubjectTypeManager object instance associated
with this PolicyManager object instance |
void |
removePolicy(java.lang.String policyName)
Deletes a policy in the organization with the given name. |
void |
replacePolicy(Policy policy)
Replaces a policy object in the data store with the same policy name |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String POLICY_SERVICE_NAME
public static final java.lang.String ORGANIZATION_NAME
Constructor Detail |
public PolicyManager(SSOToken token) throws SSOException, PolicyException
PolicyManager
for the
top (or root) organization. It requires a SSOToken
which will be used to perform all data store
operations. If the user does not have sufficient
privileges NoPermissionException
will be thrown.token
- SSO token of the user managing policySSOException
- invalid or expired single-sign-on tokenPolicyException
- for any other abnormal conditionpublic PolicyManager(SSOToken token, java.lang.String name) throws SSOException, NameNotFoundException, PolicyException
PolicyManager
for the
specified organization, sub organization or a container object.
The names of the organization, sub organization or the
container object could be either "/" separated (as per SMS)
or could be the complete DN of the object.
For example: /isp/coke, /isp/pepsi/tacobell,
etc., or "ou=tacobell, o=pepsi, o=isp",
"o=coke, o=isp", etc.
The constructor also requires a single sign on token.
which will be used to perform all data store
operations. If the user does not have sufficient
privileges NoPermissionException
will be thrown.
- Parameters:
token
- single-sign-on token of the user managing policiesname
- name of the organization, sub organization
or container for which to manage policies.
The name could be either slash (/) separated
or the complete DN.- Throws:
SSOException
- invalid or expired single-sign-on tokenNameNotFoundException
- if the given organization,
sub-organization or container name is not presentPolicyException
- for any other abnormal condition
Method Detail |
public java.lang.String getOrganizationName()
public java.util.Set getPolicyNames() throws SSOException, NoPermissionException, PolicyException
SSOException
- invalid or expired single-sign-on tokenNoPermissionException
- user does not have sufficient
privileges to get policy namesPolicyException
- for any other abnormal conditionpublic java.util.Set getPolicyNames(java.lang.String pattern) throws SSOException, NoPermissionException, PolicyException
pattern
- search pattern that will be used to select policy namesSSOException
- invalid or expired single-sign-on tokenNoPermissionException
- user does not have sufficient
privileges to get policy namesPolicyException
- for any other abnormal conditionpublic Policy getPolicy(java.lang.String policyName) throws SSOException, NoPermissionException, InvalidFormatException, NameNotFoundException, InvalidNameException, PolicyException
policyName
- name of the policySSOException
- if single sign on token associated with the policy
manager is not valid.NoPermissionException
- if not enough permissions.InvalidFormatException
- if policyName
has
invalid format.NameNotFoundException
- if the policy is not found.InvalidNameException
- if policyName
is invalid.PolicyException
- for any other abnormal condition.public void addPolicy(Policy policy) throws SSOException, NameAlreadyExistsException, NoPermissionException, InvalidFormatException, PolicyException
policy
- policy object to be added to the organizationSSOException
- invalid or expired single-sign-on tokenNoPermissionException
- user does not have sufficient
privileges to add policyInvalidFormatException
- the data in the policy object
has been corrupted or does not have a valid formatNameAlreadyExistsException
- a policy with the same
name already existsPolicyException
- for any other abnormal conditionpublic void replacePolicy(Policy policy) throws SSOException, NameNotFoundException, NoPermissionException, InvalidFormatException, PolicyException
policy
- policy object to be added to the organizationSSOException
- invalid or expired single-sign-on tokenNoPermissionException
- user does not have sufficient
privileges to replace policyNameNotFoundException
- policy with the same name does
not exist.InvalidFormatException
- the provide policy from the
data store has been corrupted or does not have a valid formatPolicyException
- for any other abnormal condition.public void removePolicy(java.lang.String policyName) throws SSOException, NoPermissionException, PolicyException
policyName
- name of the policy to be deletedSSOException
- invalid or expired single-sign-on tokenNoPermissionException
- user does not have sufficient
privileges to remove policiesPolicyException
- for any other abnormal conditionpublic ResourceManager getResourceManager()
ResourceManager
object instance associated
with this PolicyManager
object instanceResourceManager
objectpublic SubjectTypeManager getSubjectTypeManager()
SubjectTypeManager
object instance associated
with this PolicyManager
object instanceSubjectTypeManager
objectpublic ConditionTypeManager getConditionTypeManager()
ConditionTypeManager
object instance associated
with this PolicyManager
object instanceConditionTypeManager
objectpublic ReferralTypeManager getReferralTypeManager()
ReferralTypeManager
associated with this
policy manager.ReferralTypeManager
associated with this
policy manager.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |