com.sun.identity.policy
クラス PolicyManager

java.lang.Object
  上位を拡張 com.sun.identity.policy.PolicyManager

public final class PolicyManager
extends Object

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.


フィールドの概要
static String ORGANIZATION_NAME
          The key for the plugins to get the organization name.
static String POLICY_SERVICE_NAME
          The service name for Policy component.
 
コンストラクタの概要
PolicyManager(SSOToken token)
          Constructor for PolicyManager for the top (or root) organization.
PolicyManager(SSOToken token, String name)
          Constructor for PolicyManager for the specified organization, sub organization or a container object.
 
メソッドの概要
 void addPolicy(Policy policy)
          Adds a policy to the data store.
 ConditionTypeManager getConditionTypeManager()
          Gets the ConditionTypeManager object instance associated with this PolicyManager object instance
 String getOrganizationName()
          Gets the organization name for which the policy manager was initialized with.
 Policy getPolicy(String policyName)
          Gets the policy object given the name of the policy.
 Set getPolicyNames()
          Gets a set of names of polices defined in the organization for which the policy manager was instantiated.
 Set getPolicyNames(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(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
 

フィールドの詳細

POLICY_SERVICE_NAME

public static final String POLICY_SERVICE_NAME
The service name for Policy component.

関連項目:
定数フィールド値

ORGANIZATION_NAME

public static final String ORGANIZATION_NAME
The key for the plugins to get the organization name.

関連項目:
定数フィールド値
コンストラクタの詳細

PolicyManager

public PolicyManager(SSOToken token)
              throws SSOException,
                     PolicyException
Constructor for 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 - SSOToken of the user managing policy
例外:
SSOException - invalid or expired single-sign-on token
PolicyException - for any other abnormal condition

PolicyManager

public PolicyManager(SSOToken token,
                     String name)
              throws SSOException,
                     NameNotFoundException,
                     PolicyException
Constructor for 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.

パラメータ:
token - single-sign-on token of the user managing policies
name - name of the organization, sub organization or container for which to manage policies. The name could be either slash (/) separated or the complete DN.
例外:
SSOException - invalid or expired single-sign-on token
NameNotFoundException - if the given organization, sub-organization or container name is not present
PolicyException - for any other abnormal condition
メソッドの詳細

getOrganizationName

public String getOrganizationName()
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.

戻り値:
organization name for which the policy manager was instantiated

getPolicyNames

public Set getPolicyNames()
                   throws SSOException,
                          NoPermissionException,
                          PolicyException
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).

戻り値:
Set of names of policies defined in the organization
例外:
SSOException - invalid or expired single-sign-on token
NoPermissionException - user does not have sufficient privileges to get policy names
PolicyException - for any other abnormal condition

getPolicyNames

public Set getPolicyNames(String pattern)
                   throws SSOException,
                          NoPermissionException,
                          PolicyException
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).

パラメータ:
pattern - search pattern that will be used to select policy names
戻り値:
Set of policy names that satisfy the pattern
例外:
SSOException - invalid or expired single-sign-on token
NoPermissionException - user does not have sufficient privileges to get policy names
PolicyException - for any other abnormal condition

getPolicy

public Policy getPolicy(String policyName)
                 throws SSOException,
                        NoPermissionException,
                        InvalidFormatException,
                        NameNotFoundException,
                        InvalidNameException,
                        PolicyException
Gets the policy object given the name of the policy.

パラメータ:
policyName - name of the policy
戻り値:
policy with the given policy name
例外:
SSOException - 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.

addPolicy

public void addPolicy(Policy policy)
               throws SSOException,
                      NameAlreadyExistsException,
                      NoPermissionException,
                      InvalidFormatException,
                      PolicyException
Adds a policy to the data store.

パラメータ:
policy - policy object to be added to the organization
例外:
SSOException - invalid or expired single-sign-on token
NoPermissionException - user does not have sufficient privileges to add policy
InvalidFormatException - the data in the policy object has been corrupted or does not have a valid format
NameAlreadyExistsException - a policy with the same name already exists
PolicyException - for any other abnormal condition

replacePolicy

public void replacePolicy(Policy policy)
                   throws SSOException,
                          NameNotFoundException,
                          NoPermissionException,
                          InvalidFormatException,
                          PolicyException
Replaces a policy object in the data store with the same policy name

パラメータ:
policy - policy object to be added to the organization
例外:
SSOException - invalid or expired single-sign-on token
NoPermissionException - user does not have sufficient privileges to replace policy
NameNotFoundException - 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 format
PolicyException - for any other abnormal condition.

removePolicy

public void removePolicy(String policyName)
                  throws SSOException,
                         NoPermissionException,
                         PolicyException
Deletes a policy in the organization with the given name.

パラメータ:
policyName - name of the policy to be deleted
例外:
SSOException - invalid or expired single-sign-on token
NoPermissionException - user does not have sufficient privileges to remove policies
PolicyException - for any other abnormal condition

getResourceManager

public ResourceManager getResourceManager()
Gets the ResourceManager object instance associated with this PolicyManager object instance

戻り値:
ResourceManager object

getSubjectTypeManager

public SubjectTypeManager getSubjectTypeManager()
Gets the SubjectTypeManager object instance associated with this PolicyManager object instance

戻り値:
SubjectTypeManager object

getConditionTypeManager

public ConditionTypeManager getConditionTypeManager()
Gets the ConditionTypeManager object instance associated with this PolicyManager object instance

戻り値:
ConditionTypeManager object

getReferralTypeManager

public ReferralTypeManager getReferralTypeManager()
Returns ReferralTypeManager associated with this policy manager.

戻り値:
ReferralTypeManager associated with this policy manager.