Package com.sun.identity.policy
Class PolicyManager
- java.lang.Object
-
- com.sun.identity.policy.PolicyManager
-
@Deprecated public final class PolicyManager extends Object
Deprecated.since 12.0.0ThePolicyManagerclass 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
SSOTokenand privileges to the backend datastore.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDELEGATION_REALMDeprecated.static StringID_REPO_SERVICEDeprecated.static StringNAMED_POLICYDeprecated.static StringORG_ALIASDeprecated.static StringORG_ALIAS_URL_HTTP_PREFIXDeprecated.static StringORG_ALIAS_URL_HTTPS_PREFIXDeprecated.static StringORG_ALIAS_URL_SUFFIXDeprecated.static StringORGANIZATION_NAMEDeprecated.The key for the plugins to get the organization name.static StringPOLICY_DEBUG_NAMEDeprecated.static StringPOLICY_ROOT_NODEDeprecated.static StringPOLICY_SERVICE_NAMEDeprecated.The service name for Policy component.
-
Constructor Summary
Constructors Constructor Description PolicyManager(SSOToken token)Deprecated.Constructor forPolicyManagerfor the top (or root) organization.PolicyManager(SSOToken token, String name)Deprecated.Constructor forPolicyManagerfor the specified organization, sub organization or a container object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddPolicy(Policy policy)Deprecated.Adds a policy to the data store.booleancanCreateNewResource(String svcTypeName)Deprecated.booleancanCreatePolicies(Set<String> services)Deprecated.ConditionTypeManagergetConditionTypeManager()Deprecated.Gets theConditionTypeManagerobject instance associated with thisPolicyManagerobject instanceSetgetManagedResourceNames()Deprecated.StringgetOrganizationName()Deprecated.Gets the organization name for which the policy manager was initialized with.SetgetPoliciesUsingRealmSubject(String subjectName)Deprecated.Gets the set of policies that use the realm subjectPolicygetPolicy(String policyName)Deprecated.Gets the policy object given the name of the policy.MapgetPolicyConfig()Deprecated.Gets the policy config attribute values defined for this policy managerStringgetPolicyDN(String policyName)Deprecated.Gets the LDAP DN (distinguished name) for the named policySetgetPolicyNames()Deprecated.Gets a set of names of polices defined in the organization for which the policy manager was instantiated.SetgetPolicyNames(String pattern)Deprecated.Gets a set of selected policy names matching the pattern in the given organization.ReferralTypeManagergetReferralTypeManager()Deprecated.ReturnsReferralTypeManagerassociated with this policy manager.ResourceManagergetResourceManager()Deprecated.Gets theResourceManagerobject instance associated with thisPolicyManagerobject instanceResponseProviderTypeManagergetResponseProviderTypeManager()Deprecated.Gets theResponseProviderTypeManagerobject instance associated with thisPolicyManagerobject instanceSubjectTypeManagergetSubjectTypeManager()Deprecated.Gets theSubjectTypeManagerobject instance associated with thisPolicyManagerobject instancestatic voidinitAdminSubject()Deprecated.To initialise the adminSubject if it was null.voidremovePolicy(String policyName)Deprecated.Deletes a policy in the organization with the given name.voidreplacePolicy(Policy policy)Deprecated.Replaces a policy object in the data store with the same policy name
-
-
-
Field Detail
-
POLICY_SERVICE_NAME
public static final String POLICY_SERVICE_NAME
Deprecated.The service name for Policy component.- See Also:
- Constant Field Values
-
POLICY_DEBUG_NAME
public static final String POLICY_DEBUG_NAME
Deprecated.- See Also:
- Constant Field Values
-
ORGANIZATION_NAME
public static final String ORGANIZATION_NAME
Deprecated.The key for the plugins to get the organization name.- See Also:
- Constant Field Values
-
DELEGATION_REALM
public static final String DELEGATION_REALM
Deprecated.- See Also:
- Constant Field Values
-
NAMED_POLICY
public static final String NAMED_POLICY
Deprecated.- See Also:
- Constant Field Values
-
POLICY_ROOT_NODE
public static final String POLICY_ROOT_NODE
Deprecated.- See Also:
- Constant Field Values
-
ID_REPO_SERVICE
public static final String ID_REPO_SERVICE
Deprecated.- See Also:
- Constant Field Values
-
ORG_ALIAS
public static final String ORG_ALIAS
Deprecated.- See Also:
- Constant Field Values
-
ORG_ALIAS_URL_HTTP_PREFIX
public static final String ORG_ALIAS_URL_HTTP_PREFIX
Deprecated.- See Also:
- Constant Field Values
-
ORG_ALIAS_URL_HTTPS_PREFIX
public static final String ORG_ALIAS_URL_HTTPS_PREFIX
Deprecated.- See Also:
- Constant Field Values
-
ORG_ALIAS_URL_SUFFIX
public static final String ORG_ALIAS_URL_SUFFIX
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PolicyManager
public PolicyManager(SSOToken token) throws SSOException, PolicyException
Deprecated.Constructor forPolicyManagerfor the top (or root) organization. It requires aSSOTokenwhich will be used to perform all data store operations. If the user does not have sufficient privilegesNoPermissionExceptionwill be thrown.- Parameters:
token-SSOTokenof the user managing policy- Throws:
SSOException- invalid or expired single-sign-on tokenPolicyException- for any other abnormal condition
-
PolicyManager
public PolicyManager(SSOToken token, String name) throws SSOException, NameNotFoundException, PolicyException
Deprecated.Constructor forPolicyManagerfor 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 privilegesNoPermissionExceptionwill 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
-
getOrganizationName
public String getOrganizationName()
Deprecated.Gets the organization name for which the policy manager was initialized with. The organization name could either be slash ("/") separated or could be the distinguished name depending on the manner in which it was initialized.- Returns:
- organization name for which the policy manager was instantiated
-
getPolicyConfig
public Map getPolicyConfig()
Deprecated.Gets the policy config attribute values defined for this policy manager- Returns:
- policy config attributes defined for this policy manager. Also, includes the organization distinguished name.
-
getPolicyNames
public Set getPolicyNames() throws SSOException, NoPermissionException, PolicyException
Deprecated.Gets a set of names of polices defined in the organization for which the policy manager was instantiated. If there are no policies defined, this method returns an empty set (not null).- Returns:
Setof names of policies defined in the organization- Throws:
SSOException- invalid or expired single-sign-on tokenNoPermissionException- user does not have sufficient privileges to get policy namesPolicyException- for any other abnormal condition
-
getPolicyNames
public Set getPolicyNames(String pattern) throws SSOException, NoPermissionException, PolicyException
Deprecated.Gets a set of selected policy names matching the pattern in the given organization. The pattern accepts "*" as the wild card for searching policy names. For example if the pattern is "co*", it returns policies starting with "co". Similarly, if the pattern is "*net", it returns policies ending with "net". The wildcard can be anywhere in the the string. If there are no policies that match the provided filter, this method returns an empty set (not null).- Parameters:
pattern- search pattern that will be used to select policy names- Returns:
Setof policy names that satisfy the pattern- Throws:
SSOException- invalid or expired single-sign-on tokenNoPermissionException- user does not have sufficient privileges to get policy namesPolicyException- for any other abnormal condition
-
getPolicyDN
public String getPolicyDN(String policyName) throws SSOException, NoPermissionException, NameNotFoundException, PolicyException
Deprecated.Gets the LDAP DN (distinguished name) for the named policy- Parameters:
policyName- name of the policy- Returns:
- DN of the policy
- Throws:
SSOException- if single sign on token associated with the policy manager is not valid.NoPermissionException- if not enough permissionsNameNotFoundException- if the policy is not foundPolicyException- for any other abnormal condition
-
getPolicy
public Policy getPolicy(String policyName) throws SSOException, NoPermissionException, InvalidFormatException, NameNotFoundException, InvalidNameException, PolicyException
Deprecated.Gets the policy object given the name of the policy.- Parameters:
policyName- name of the policy- Returns:
- policy with the given policy name
- Throws:
SSOException- if single sign on token associated with the policy manager is not valid.NoPermissionException- if not enough permissions.InvalidFormatException- ifpolicyNamehas invalid format.NameNotFoundException- if the policy is not found.InvalidNameException- ifpolicyNameis invalid.PolicyException- for any other abnormal condition.
-
addPolicy
public void addPolicy(Policy policy) throws SSOException, NameAlreadyExistsException, NoPermissionException, InvalidFormatException, PolicyException
Deprecated.Adds a policy to the data store.- Parameters:
policy- policy object to be added to the organization- Throws:
SSOException- 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 condition
-
replacePolicy
public void replacePolicy(Policy policy) throws SSOException, NameNotFoundException, NoPermissionException, InvalidFormatException, PolicyException
Deprecated.Replaces a policy object in the data store with the same policy name- Parameters:
policy- policy object to be added to the organization- Throws:
SSOException- 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.
-
removePolicy
public void removePolicy(String policyName) throws SSOException, NoPermissionException, PolicyException
Deprecated.Deletes a policy in the organization with the given name.- Parameters:
policyName- name of the policy to be deleted- Throws:
SSOException- invalid or expired single-sign-on tokenNoPermissionException- user does not have sufficient privileges to remove policiesPolicyException- for any other abnormal condition
-
getResourceManager
public ResourceManager getResourceManager()
Deprecated.Gets theResourceManagerobject instance associated with thisPolicyManagerobject instance- Returns:
ResourceManagerobject
-
getSubjectTypeManager
public SubjectTypeManager getSubjectTypeManager()
Deprecated.Gets theSubjectTypeManagerobject instance associated with thisPolicyManagerobject instance- Returns:
SubjectTypeManagerobject
-
getConditionTypeManager
public ConditionTypeManager getConditionTypeManager()
Deprecated.Gets theConditionTypeManagerobject instance associated with thisPolicyManagerobject instance- Returns:
ConditionTypeManagerobject
-
getResponseProviderTypeManager
public ResponseProviderTypeManager getResponseProviderTypeManager()
Deprecated.Gets theResponseProviderTypeManagerobject instance associated with thisPolicyManagerobject instance- Returns:
ResponseProviderTypeManagerobject
-
getReferralTypeManager
public ReferralTypeManager getReferralTypeManager()
Deprecated.ReturnsReferralTypeManagerassociated with this policy manager.- Returns:
ReferralTypeManagerassociated with this policy manager.
-
getPoliciesUsingRealmSubject
public Set getPoliciesUsingRealmSubject(String subjectName) throws PolicyException, SSOException
Deprecated.Gets the set of policies that use the realm subject- Parameters:
subjectName- name of the realm subject to check for- Returns:
- a
SetofPolicyobjects that use the realm subject - Throws:
PolicyExceptionSSOException
-
getManagedResourceNames
public Set getManagedResourceNames() throws PolicyException
Deprecated.- Throws:
PolicyException
-
canCreatePolicies
public boolean canCreatePolicies(Set<String> services) throws EntitlementException
Deprecated.- Throws:
EntitlementException
-
canCreateNewResource
public boolean canCreateNewResource(String svcTypeName)
Deprecated.
-
initAdminSubject
public static void initAdminSubject()
Deprecated.To initialise the adminSubject if it was null. This must be non-null for the migratedToEntitlementService to have been calculated correctly
-
-