Sun OpenSSO Enterprise 8.0 Developer's Guide

PolicyManager

com.sun.identity.policy.PolicyManager is the top-level administrator class for policy management in a specific realm. This class provides methods that enable the administrator to add, look up, modify, replace and delete policies. Only a privileged user with access to the policy data store and a valid session token can create a PolicyManager object. Some of the more widely used methods include:

getPolicyNames()

Retrieves all named policies created in the realm for which the PolicyManager object was instantiated. This method can also take a pattern (filter) as an argument.

getPolicy()

Retrieves a policy when given the policy name.

addPolicy()

Adds a policy to the realm for which the PolicyManager object was instantiated. If a policy with the same name already exists, it will be overwritten.

removePolicy()

Removes a policy from the realm for which the PolicyManager object was instantiated.

replacePolicy()

Overwrites a policy already defined in the realm for which the PolicyManager object was instantiated.